AndroidStudio unit test generates test reports and generates unit test code coverage reports

If you want to calculate the coverage of AndroidTest, you only need to add the coverage statistics to the buildTypes closure in the module's build.gradle

debug {    
    testCoverageEnabled true
}

To generate a report, you can find the Gradle menu in AS, find verification -> createDebugCoverageReport, right click and run this task.
insert image description here

If this is displayed after configuration,
insert image description here
click to enter:
insert image description here
Uncheck it, and you can see the task list after synchronization

Guess you like

Origin blog.csdn.net/github_37610197/article/details/125386717