title: jenkins uiautomator build always green
body: <p>So I defined many UiAutomatorTestCase classes, each has 1 or 2 test cases at the most.
  Then I use Shell script on Jenkins to string these test cases into a series of tests, for example:</p>
  
  <pre><code>adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass1
  adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass2
  adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass3
  adb shell uiautomator runtest myTest.jar -c com.myTest.TestClass4
  ...
  so on so forth.
  </code></pre>
  
  <p>one of the two (1/2) problems I have is that with Jenkins builds, it doesn't matter if any of these test fails, Jenkins always shows up as green, I need Jenkins stop and shows red for the build.</p>
  
  <p>the other (2/2) problem is that if the app crashes in one of the tests, say, TestClass2, the script will try to pick up and continue executing. What would be the best method to make the script stop?</p>
  
  <p>Any suggestions?
  Thanks</p>