简体   繁体   English

如果将shareduserId设置为“ android.uid.system”,则无法运行Android单元测试

[英]cannot run android unit test if I set the shareduserId as “android.uid.system”

I got a problem when I was running a test that the target Package's sharedUserId is "android.uid.system" 我在运行测试时发现目标软件包的sharedUserId为“ android.uid.system”时出现问题

when I type this in shell 当我在shell中键入

    adb shell am instrument -w -e class com.lewa.security2.holder.ClearanceHolderTest     com.lewa.dunit.test/android.test.InstrumentationTestRunner

it never return a result. 它永远不会返回结果。

but when I remove the "android.uid.system", it just works 但是当我删除“ android.uid.system”时,它就可以了

can any one help me ? 谁能帮我 ?

a unit test in android need to run after you kill the application. 在杀死应用程序后,需要运行android中的单元测试。 but applicaions with the shareduid android.uid.system cannot be killed in this way. 但无法以这种方式杀死具有shareduid android.uid.system应用程序。 so,you need to force close the application before run unit tests. 因此,您需要在运行单元测试之前强制关闭应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM