0

I want to perform exploratory testing on an app my team is developing, and for this, I'd like to be able to manually hide and unhide apps on an AVD. Is there a way I can do this?

I observe that with adb shell, pm hide $PACKAGE is available, but I don't appear to have permission. The terminal shows me the output:

java.lang.SecurityException: Neither user 2000 nor current process has android.permission.MANAGE_USERS.

Is there a workaround on an AVD? I'm on Android 11. Can I start adb shell with the necessary permissions?

(I really don't want to have to write an app, make it the device manager, and run it to hide other apps.)

4
  • What does pm disable-user $PACKAGE does?
    – Firelord
    Jul 21, 2022 at 18:56
  • That gives the output Package cs.rcherz new state: disabled-user. After having done so, though, pm hide cs.rcherz still gives the error message about android.permission.MANAGE_USERS which is printed above. Jul 21, 2022 at 19:36
  • One you have already disabled an app, why do you want to continue with hide?
    – Firelord
    Jul 22, 2022 at 9:44
  • @Firelord I want apps hidden because I'm doing exploratory testing for our MDM app. In particular, I want to verify its behaviours with respect to hidden apps. Being able to hide the apps with a simple execution from the shell would facilitate this exploration. Jul 22, 2022 at 15:40

0

You must log in to answer this question.

Browse other questions tagged .