我使用Instrumentation来测试PhoneApp,通过Instrumentation编写了我的测试应用程序。
我创建了一个apk并将其安装在Nexus One-Android手机上,这一步已经通过了。在我的代码中,我使用了一些不是标准SDK的内部类。我没有在Eclipse中构建它,而是在我的嵌入式环境中构建它。我在一家为Android开发的公司工作,所以我有一个包含所有内部库的Android树。
我在清单文件中使用了适当的权限。
我的apk可能使用了某个签名,但这个签名可能不够好。
现在我通过adb运行测试,立即收到了这个错误:
-------------------------------------------------------------------------------------
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Permission Denial: starting instrumentation ComponentInfo{com.android.phonetests/com.android.phonetests.PhoneInstrumentationTestRunner} from pid=495, uid=495 not allowed because package com.android.phonetests does not have a
signature matching the target com.android.phone
INSTRUMENTATION_STATUS_CODE: -1
java.
lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{com.android.phonetests/com.android.phonetests.PhoneInstrumentationTestRunner} from pid=495, uid=495 not allowed because package com.android.phonetests does not have a
signature matching the target com.android.phone
-------------------------------------------------------------------------------------
请帮忙。
signingConfig
。但我错了,因为项目定义了一个signingConfigs.debug
,它被隐式地用作调试的签名配置!非常感谢! - Luke Needham