艾玛失败了,如何调试在模拟器上运行的android测试用例?

发布于 2025-01-07 21:07:09 字数 1065 浏览 1 评论 0原文

我试图通过在我的 mavenized android 项目上运行 ant emma 来获取覆盖率报告,其他一切都很顺利,但是当运行

ant emma debug install test. 

输出时我遇到了 NullPointerException:

test:
 [echo] WARNING: Code Coverage is currently only supported on the emulator and rooted devices.
 [echo] Running tests ...
 [exec] 
 [exec] com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivityTest:INSTRUMENTATION_RESULT: shortMsg=java.lang.NullPointerException
 [exec] INSTRUMENTATION_RESULT: longMsg=java.lang.NullPointerException: Unable to start activity ComponentInfo{com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp/com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivity}: java.lang.NullPointerException
 [exec] INSTRUMENTATION_CODE: 0
 [echo] Downloading coverage file into project directory...
 [exec] remote object '/data/data/com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp/coverage.ec' does not exist

如何调试这个?我想知道NPE发生在哪里。

I am trying to get coverage report by running ant emma on my mavenized android project, everything else went smoothly, but i bumped into NullPointerException when running

ant emma debug install test. 

output is:

test:
 [echo] WARNING: Code Coverage is currently only supported on the emulator and rooted devices.
 [echo] Running tests ...
 [exec] 
 [exec] com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivityTest:INSTRUMENTATION_RESULT: shortMsg=java.lang.NullPointerException
 [exec] INSTRUMENTATION_RESULT: longMsg=java.lang.NullPointerException: Unable to start activity ComponentInfo{com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp/com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivity}: java.lang.NullPointerException
 [exec] INSTRUMENTATION_CODE: 0
 [echo] Downloading coverage file into project directory...
 [exec] remote object '/data/data/com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp/coverage.ec' does not exist

How can I debug this ? I would like to find out where the NPE happened.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文