我使用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
-------------------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)
请帮忙.
您找到解决这个问题的方法了吗?当我在使用另一个密钥签名的设备上仍然安装了测试 apk 时,我可以重现此问题。
因此,为了修复,请首先使用应用程序包和测试包执行 adb uninstall 。
adb uninstall com.android.phone
adb uninstall com.android.phonetests
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14939 次 |
| 最近记录: |