Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

android

adb

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 adb install /path/to/app.apk installs the app globally; every user can see and launch it (as if every user installed the same app from the Play store for example).

Is there a way to adb install an app onto a device so that only one user can see it in the launcher menu?

like image 226
Forest Katsch Avatar asked Dec 23 '13 15:12

Forest Katsch


People also ask

What is ADB install APK?

ADB (Android Debugging Bridge) can be used to execute commands on your VR device. It's mostly used to install applications (APK files) from a Windows PC or Mac with a device connected with USB.

How do I use ADB on Windows?

How to setup ADB on Microsoft Windows. Download the Android SDK Platform Tools ZIP file for Windows. Then open up a Command Prompt from the same directory as this ADB binary. This can be done by holding Shift and Right-clicking within the folder then click the “Open command window here” option.


1 Answers

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.

like image 166
petrkotek Avatar answered Sep 25 '22 02:09

petrkotek