How to retrieve test results when using “adb shell am instrument”

前端 未结 3 367
伪装坚强ぢ
伪装坚强ぢ 2020-12-30 10:30

I\'m executing some tests in my Android device by using the following command:

adb shell am instrument -w package.name/android.test.runner.AndroidJU

3条回答
  •  天涯浪人
    2020-12-30 10:50

    But, does this process also generates a results file inside the device (xml, html, etc)?

    No, it does not.

    Report generation is generally handled at a higher layer than 'am instrument'. If you run your tests using Gradle, it should generate the report for you. I believe this is what Android Studio relies on as well.

    If you must generate the report from the test itself, you can use a custom test runner. See this answer for one way to do it: http://www.stackoverflow.com/a/5574418/1999084

提交回复
热议问题