cannot run android unit test if I set the shareduserId as "android.uid.system"

StackOverflow https://stackoverflow.com/questions/17585865

  •  02-06-2022
  •  | 
  •  

سؤال

I got a problem when I was running a test that the target Package's sharedUserId is "android.uid.system"

when I type this in 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

can any one help me ?

هل كانت مفيدة؟

المحلول

a unit test in android need to run after you kill the application. but applicaions with the shareduid android.uid.system cannot be killed in this way. so,you need to force close the application before run unit tests.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top