I had a similar problem (I wanted to have xml test reports for my Jenkins when it runs control tests on the device). I solved this by running "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'
into your build.gradle (note the androidTest prefix - this will not add code to your production application!).
To use it, add:
-e listener de.schroepf.androidxmlrunlistener.XmlRunListener
to your appliance team.
And to get the XML report file use:
adb pull /storage/emulated/0/Android/data/<your-app-package-name>/files/report.xml
source share