Right now, Android Studio integrates jacoco automatically to do code coverage.
You just need to add a few lines of code:
apply plugin: 'jacoco-android'
android {
buildTypes {
debug {
testCoverageEnabled = true
}
}
}
More information here:
- http://blog.wittchen.biz.pl/test-coverage-report-for-android-application/