Step 4.運行
首先通過模擬器運行一下AndroidUT,然后在命令行終端中運行
Java代碼

adb shell am instrument -e class com.android.ut.test.TestApp -wcom.android.ut/android.test.InstrumentationTestRunner
adb shell am instrument -e class com.android.ut.test.TestApp -wcom.android.ut/android.test.InstrumentationTestRunner
這樣你就可以看到測試結果了。
Java代碼

# am instrument -e class com.cn.test.TestApp -w com.cn/android.test.InstrumentationTestRunner
com.cn.test.TestApp:..
Test results for InstrumentationTestRunner=..
Time: 2.866
OK (2 tests)
# am instrument -e class com.cn.test.TestApp -w com.cn/android.test.InstrumentationTestRunner
com.cn.test.TestApp:..
Test results for InstrumentationTestRunner=..
Time: 2.866
OK (2 tests)
后臺測試log日志信息
文章來源于領測軟件測試網 http://www.kjueaiud.com/