generating code coverage report for android test p

2019-01-28 21:54发布

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.

3条回答
Fickle 薄情
2楼-- · 2019-01-28 22:23

Try ant all clean emma debug install test in the test project root after cleaning, updating and building both the projects

查看更多
祖国的老花朵
3楼-- · 2019-01-28 22:25
  1. Go to Java build Path
  2. Go to Source
  3. Change Default output folder from: ProjectName/classes to Project/bin/classes
查看更多
4楼-- · 2019-01-28 22:29

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

查看更多
登录 后发表回答