How to use `adb` to install development apps for one user only?

前端 未结 4 2173
耶瑟儿~
耶瑟儿~ 2020-12-06 09:14

Android 4.2 on tablets added support for multiple users per device (similar to desktop OSes), each of which can install and remove apps independently. Currently, using

4条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-06 09:59

    It may not have a per-user 'adb install', but it does have a per-user 'start' option when you want actual run the APK for testing. By default the documentation says 'start' will just start for the currently running user, but you can do

    adb shell am start --user USER activity...
    

    to start the APK as someone else. To get a list of users, run

    adb shell pm list users
    

提交回复
热议问题