问题
i am trying to get a coverage report for my android junit test project and following this guide to do so
android update test-project -m <path to app project> -p <path to test project>
worked fine. it generated a build.xml and updated project.properties, local.properties and proguard.cfg.
but when I change directory to test project directory and enter command
ant coverage
it gives me this error.
BUILD FAILED
Target "coverage" does not exist in the project "My Project Test".
Total time: 0 seconds
I am using windows xp.
回答1:
Which SDK Tools version are you using? If it is 14 or later, you need to use ant emma debug install test
instead of ant coverage
回答2:
- Go to Java build Path
- Go to Source
- Change Default output folder from:
ProjectName/classes
toProject/bin/classes
回答3:
Try ant all clean emma debug install test in the test project root after cleaning, updating and building both the projects
来源:https://stackoverflow.com/questions/8295834/generating-code-coverage-report-for-android-test-project