问题解决:INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for

只有apk包,创建空android test project时,如果src节点下的文件要和 gen文件下一致,否则运行adb shell命令时,会报错。

因为我们创建junit test case 时,习惯上会保持和被测试app一致如:cn.mama.activity.test。但自动生成的目录却不是这个

把测试项目打包后,用aapt.exe工具查看,会发现包名是gen的子目录一致,而不是src下的子目录:

血的教训

D:\adt-bundle-windows-x86_64-20131030\others\resignedAPK>adb shell am instrument
 -w -e class cn.mama.activity.test.TestMMQ cn.mama.activity.test/android.test.In
strumentationTestRunner
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation info for: Component
Info{cn.mama.activity.test/android.test.InstrumentationTestRunner}
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: cn.mama.activity.test/and
roid.test.InstrumentationTestRunner
        at com.android.commands.am.Am.runInstrument(Am.java:593)
        at com.android.commands.am.Am.run(Am.java:118)
        at com.android.commands.am.Am.main(Am.java:81)
        at com.android.internal.os.RuntimeInit.finishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:238)
        at dalvik.system.NativeStart.main(Native Method)

转载于:https://www.cnblogs.com/zhitang2009/p/3418314.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值