generating code coverage report for android test project

匆匆过客 提交于 2019-12-18 09:06:57

问题


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:


  1. Go to Java build Path
  2. Go to Source
  3. Change Default output folder from: ProjectName/classes to Project/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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!