I'm executing some tests in my Android device by using the following command:
adb shell am instrument -w package.name/android.test.runner.AndroidJUnitRunner
I can see the test progress and simple results through STDOUT. But, does this process also generates a results file inside the device (xml, html, etc)? If yes, where is it stored?
Thanks
I had a similar problem (I wanted to have xml test reports for my Jenkins when it runs instrumentation tests on a device). I solved it by implementing the "android-xml-run-listener" (https://github.com/schroepf/TestLab/tree/master/android).
To use it simply add:
androidTestCompile 'de.schroepf:android-xml-run-listener:0.1.3'
to your build.gradle (note the androidTest prefix - this will not add code to your production app!).
To use it, add:
-e listener de.schroepf.androidxmlrunlistener.XmlRunListener
to your am instrument command.
And to retrieve the XML report file, use:
adb pull /storage/emulated/0/Android/data/<your-app-package-name>/files/report.xml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With