Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Local Unit test with coverage report from command line

I am working on a new project for Android. Currently, I am using Android studio as IDE. I need to run Unit test and System (CI) test flows which can be run on both Local machine (JVM) and Emulator/Real Device for instrumentation.

Note that I am running all unit tests via command line.

For get the code coverage of the Emulator/Real Device I am using Jacoco. and running the following command: gradlew createDebugCoverageReport However, I can't find any way to run the Local machine unit test with coverage report from command line. The only way is to run it from the android studio by selecting "Run XXX with Code Coverage":

enter image description here

Can you please advise if it is possible to run local unit test from command line with coverage. And get the report as an html file?

Thanks, Zachi

like image 935
Zachi Avatar asked Nov 16 '15 15:11

Zachi


1 Answers

The report can be generated using the android studio, after you run the test with coverage the results window appears, click the button bordered with red

Check this image:

image

like image 91
هيثم Avatar answered Oct 05 '22 14:10

هيثم