Let's say we have a Work Profile (Android For Work) enabled in Android device. Does anyone know how to install an APK via ADB in Work Profile rather than personal profile.
I have seen the ADB documentation and there's a way to get the User ID but using the same ID I am unable to install an APK.
To get ID : adb shell pm list users
Install command : adb install -r --user 12 app_name.apk
Error message :
Performing Streamed Install
adb: failed to install app-prodDebug.apk: Security exception: Shell does not have permission to access user 12
com.android.server.am.ActivityManagerService.handleIncomingUser:22541 android.app.ActivityManager.handleIncomingUser:3989 com.android.server.pm.PackageManagerShellCommand.translateUserId:2434
java.lang.SecurityException: Shell does not have permission to access user 12
com.android.server.am.ActivityManagerService.handleIncomingUser:22541 android.app.ActivityManager.handleIncomingUser:3989 com.android.server.pm.PackageManagerShellComma
Any way to get around this ? My use case here is to replace an App with debug option enabled so that I can troubleshoot any issue that is happening with that specific app which is installed in work profile.
You can install these apps from the Google Play Store app in your work profile. On your device, open the Google Play Store app that has a briefcase badge. Browse for the app that you want to install. On the app page, tap Install and follow the installation procedure.
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.
Tap on the Security option. Scroll down until you see Unknown sources and check the box. Open your file browser and navigate to your download folder where the APK is. Tap the APK and follow the instructions to install the app.
adb push android.apk /data/local/tmp
adb shell pm install --user 12 /data/local/tmp/android.apk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With