问题解决: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)

    原文作者:ActivityManagerService
    原文地址: http://www.cnblogs.com/zhitang2009/p/3418314.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞