How to use `adb` to install development apps for one user only?
adb install
now supports --user USER_ID
argument, so in order to install APK for a certain user, use:
adb install --user USER_ID PATH_TO_APK
In order to find out USER_ID, use adb shell pm list users
.
See https://source.android.com/devices/tech/admin/multi-user-testing for details.
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
pm enable [--user USER_ID] PACKAGE_OR_COMPONENT
pm disable [--user USER_ID] PACKAGE_OR_COMPONENT
pm enable --user 12 org.mozilla.firefox_beta