APK Downloader
·13 min read

APK Won't Install in a Work Profile or Second Space: Android Multi-User Isolation and pm install --user, Diagnosed Step by Step

The same APK installs and runs in the main space, but fails in a Work Profile, Second Space, Private Space or Secure Folder - or installs and then vanishes when you switch users. This is not a corrupt package. Android maintains a separate installed-app set per UserHandle, adb install targets only the current user by default, and a device policy can restrict installs for one user alone. A multi-user mechanism table, runnable adb commands, a nine-step diagnostic path, an error-code reference, OEM differences, an FAQ, and verified internal links.

multi-userWork Profilepm installadbtroubleshooting

There is a class of problem that makes people assume they downloaded a bad build. The very same APK installs and works in the phone's main space, but switch to a Work Profile, Second Space, Private Space or Secure Folder and tapping it either returns "App not installed" or installs with no icon at all. Pushing it over adb produces a wall of cryptic INSTALL_FAILED_* codes.

So people uninstall repeatedly, switch download sources, hunt for a "multi-user edition". None of that touches the cause. If the main space installs it, the APK file is fine. Failing in another space happens because Android treats "who is this installed for" as a separate decision.

The key distinction: on Android, "installed apps" is not one global list - it is one list per user (UserHandle). The system user (user 0), a Work Profile (typically a managed profile like user 10), and a Second Space (a secondary user) each maintain their own. The APK file can be shared from the same storage, but "is this package installed for this user" is recorded independently. So adb install acting only on the current user by default is by design, not a bug.

This article takes that isolation model apart, gives you a command to verify every stage, and explains which cases are limited by device policy and cannot be worked around from the device.

1. Distinguish four kinds of "won't install"

SymptomMost likely layerHow it differsFirst check
Works in main space, "App not installed" in Work ProfilePer-user install setThe package itself is usablepm list users + pm list packages --user
Tapping an APK in the second space silently failsInstall restriction on that userEvery APK failsdumpsys user restrictions
adb install succeeds but no icon in the second spaceInstalled into user 0Visible in the main spacepm install --user <id>
Installs but crashes immediately on launchCross-user start / data dir / permissionsInstallation succeededam start --user, logcat

If it does not install even in the main space, that is out of scope here - see APK install failed troubleshooting or APK install failed troubleshooting. This article covers "main space fine, one user space broken".

2. Mechanism table: what multi-user actually isolates

DimensionSystem user 0Work Profile / Second Space user NShared?
Installed-app setIts ownIts ownNo (may point at the same APK path)
App data directory/data/user/0/<pkg>/data/user/N/<pkg>No, fully isolated
UIDappId (usually 10000+)N*100000 + appIdNo, UID ranges are per user
Runtime permission grantsTracked separatelyTracked separatelyNo
Notifications / accounts / clipboardSeparateSeparateNo
APK file itself/data/app/...The same base.apkYes (package shared)
Home screen / LauncherMain launcherBadged work apps or second-space launcherNo
Install unknown apps toggleEvaluated per userEvaluated per userNo
Device policy install restrictionsCan be set separatelyCan be set separately (Work Profile often managed)No

Three conclusions worth keeping:

  • "Installing" and "enabling for a user" are two different operations. The system has pm install-existing --user N <pkg>: it does not re-copy the APK, it just registers a package already present on the device for another user. That is why installing the same build into a second space is often very fast.
  • Data never crosses. Accounts you are logged into and caches in the main space do not appear in the Work Profile. Both sides need their own install and their own login. This is also why people misread "it installed but did not work".
  • **A Work Profile is a *managed* user. If the device is enrolled in an MDM / device owner (Profile Owner), the administrator can set `DISALLOW_INSTALL_APPS` or `DISALLOW_INSTALL_UNKNOWN_SOURCES` directly. Those restrictions cannot be bypassed from the device, and should not be** - they are corporate compliance policy. Background: restricted settings and sideloading.

3. OEM differences: these names are all multi-user under the hood

Vendors give multi-user different names. The mechanism is similar, but how open it is varies a lot.

NameVendorUnderlying typeTypical sideload behavior
Work ProfileAOSP, most AndroidManaged Profile (user 10+)Bound by MDM policy, unknown sources often blocked
Second Space / dual spaceXiaomi, RedmiSecondary UserSideload usually allowed, but must be done inside that space
Private SpaceHuawei, HonorIndependent user spaceUnknown sources must be enabled inside the space
Secure FolderSamsung (Knox)Knox-protected containerStrict; most sideloads blocked
Dual apps / app cloneVarious vendorsUsually app-level cloning, not multi-userDifferent mechanism - see Work Profile and multi-user install troubleshooting

Important distinction: "Dual apps / app clone" typically clones one app into a second instance *within the same user*, whereas "Second Space / Work Profile" is genuine system-level multi-user. The two have entirely different diagnostic paths. For the former, see Work Profile and multi-user install troubleshooting.

4. Runnable command list

All commands need adb and USB debugging. Replace com.example.app with the target package and 10 with the user ID you actually found. Every command is read-only or installs only into the specified user - nothing wipes data.

# 1) List all users and their state (confirm the target userId; never guess)
adb shell pm list users
adb shell dumpsys user | head -60
adb shell dumpsys activity users | head -40

# 2) Which third-party packages are installed for a given user?
adb shell pm list packages --user 0 -3
adb shell pm list packages --user 10 -3
adb shell pm list packages --user 10 | grep example

# 3) For one package: which users have it, its path and UID
adb shell pm path --user 10 com.example.app
adb shell dumpsys package com.example.app | grep -iE 'User 0|User 10|userId|installed'

# 4) Push a local APK, then explicitly install into the target user
adb push app.apk /data/local/tmp/app.apk
adb shell pm install --user 10 -r /data/local/tmp/app.apk
adb shell pm install --user 10 -r -g /data/local/tmp/app.apk   # -g also grants runtime permissions

# 5) If the package is already on the device, just register it for another user (no re-copy)
adb shell pm install-existing --user 10 com.example.app
adb shell cmd package install-existing --user 10 com.example.app

# 6) Start / force-stop / uninstall for only that user
adb shell am start --user 10 -n com.example.app/.MainActivity
adb shell am force-stop --user 10 com.example.app
adb shell pm uninstall --user 10 com.example.app

# 7) Check whether that user has install restrictions (critical!)
adb shell dumpsys user | grep -iE 'restrictions|DISALLOW_INSTALL|no_install'
adb shell pm list packages --user 10 -d    # -d lists only disabled packages

# 8) Capture the real install failure reason (in a second terminal while reproducing)
adb logcat -c
adb logcat -v brief | grep -iE 'PackageManager|INSTALL_FAILED|installPackage|UserRestrictions'

# 9) Split APKs (App Bundle exports) need multi-package install
adb install-multiple --user 10 base.apk split_config.arm64_v8a.apk split_config.xxhdpi.apk

Three things to look for in the output:

  1. In pm list users, UserInfo{0:...:...} running is the primary user. The line carrying Profile or a name containing Work (or its localized equivalent) has the userId as the first number after the colon. Do not assume 10 - some devices use 11, 100 or higher.
  2. pm install --user N returning Success is what counts as installed for that user. Immediately re-check with pm list packages --user N | grep <pkg> instead of trusting the return code alone.
  3. If dumpsys user shows DISALLOW_INSTALL_APPS=true or DISALLOW_INSTALL_UNKNOWN_SOURCES=true, this is a policy block: no APK and no installer will work. For the boundary between MDM and restricted settings, see restricted settings and sideload.

Split APKs install differently from a single APK. If your download is .apks / .xapk / .apkm, see how to install split APKs and XAPK/APKS/APKM install guide first.

5. Nine-step diagnostic path

Step 1 - Establish the isolation scope. Tap the same APK once in the main space and once in the problem space. Main succeeds / other fails -> this article. Both fail -> general install-failure troubleshooting.

Step 2 - List the real userId. pm list users, write it down. This prevents every later command from targeting the wrong object.

Step 3 - Check whether it is actually already installed for that user. Many "installed but no icon" cases are simply an install into user 0. pm list packages --user N | grep <pkg> settles it. If so, see installed but no app icon.

Step 4 - Check install restrictions. dumpsys user | grep -i DISALLOW_INSTALL. If true, stop: this is device policy, need the administrator to lift it, or use the main space.

Step 5 - Check that user's unknown-sources switch. Work Profiles and second spaces usually require enabling "Install unknown apps" from inside that space for the file manager / installer. Switch into it and confirm in Settings. See unknown sources settings by brand.

Step 6 - Install explicitly with `pm install --user N`. First adb push to /data/local/tmp/ (readable for that user), then run. -r replaces, -g grants runtime permissions, -t allows test-only packages, -d allows downgrade.

Step 7 - Handle INSTALL_FAILED codes. Capture logcat while reproducing and use the reference table below. INSTALL_FAILED_USER_RESTRICTED -> back to step 4. INSTALL_FAILED_ALREADY_EXISTS -> that user already has it, use install-existing or uninstall first. INSTALL_FAILED_INVALID_URI -> usually an /sdcard path unreadable in that user, push to /data/local/tmp/ instead.

Step 8 - Single APK or split? aapt dump badging app.apk shows the basics. If the download is a set of .apks splits, you must use multi-package install; installing base.apk alone fails or yields a missing-resource crash.

Step 9 - Verify launch and data isolation. am start --user N -n <pkg>/.MainActivity to confirm it launches in the target space. Remember accounts, caches and permissions are per user - you must sign in again there. If it crashes immediately, switch to launch crash logcat guide.

6. Error-code reference

Code / keywordMeaningLayerUser-fixable?
INSTALL_FAILED_USER_RESTRICTEDThat user is forbidden to install appsDevice PolicyNo (needs admin)
INSTALL_FAILED_ALREADY_EXISTSSame package already installed for that userPer-user isolationYes (uninstall or install-existing)
INSTALL_FAILED_INVALID_URIInstaller cannot read the APK pathPath / storage isolationYes (push to /data/local/tmp)
INSTALL_FAILED_INVALID_APKAPK damaged or incompleteThe fileYes (re-download and verify)
INSTALL_FAILED_PERMISSION_MODEL_UPGRADELegacy build / permission model clashPackage compatDepends
Failure [not installed for user N]Query/uninstall: not present for that userPer-user isolationYes (confirm userId)
java.lang.SecurityException: ... userCross-user operation rejectedPermissionPartly
Tapping the APK does nothingUnknown sources not enabled in that spaceSettingsYes

For file integrity (relevant to INVALID_APK in step 7), see how to verify APK integrity and checksum. For signature conflicts producing INSTALL_FAILED_UPDATE_INCOMPATIBLE, see how to verify APK signature before installing.

7. adb install flag reference

FlagEffectCommon use
--user NInstall into a specific userCore flag for this article
-rReplace existing install (keep data)Upgrading
-dAllow downgradeInstalling an older version
-gGrant all manifest runtime permissions immediatelySkip individual prompts
-tAllow testOnly packagesDebug builds
-SAllocate by package size (streaming install)Large packages
install-existingRegister an on-device package for another userNo APK re-copy
install-multipleInstall several splits in one commitSplit APK / App Bundle

For the adb environment itself, see the complete adb install APK guide.

8. FAQ

Q1: Why do I have to install again in the Work Profile if it is already in the main space?

Because "installed" is recorded per user. Only the APK file is shared, not the registration. pm install-existing --user N <pkg> registers it quickly, but you still sign in separately in that user.

Q2: What is the difference between `adb install --user 10` and `adb shell pm install --user 10`?

The first is handled host-side by adb and forwarded; most Android versions support --user. The second calls pm directly in the device shell - same semantics, but the path must be a device path (so adb push first). If the host-side form rejects the flag, the shell form is more reliable.

Q3: The second space says "App not installed", but installing from the official store works. Is it the package?

Usually it is a per-space unknown-source restriction or an MDM policy allowing only trusted installers. Confirm with steps 4 and 5; do not keep swapping builds.

Q4: Will data from the main space leak into the Work Profile after installing?

No. Data directories are /data/user/0/<pkg> versus /data/user/10/<pkg>, with different UIDs. The Android sandbox keeps them mutually invisible - that is the entire point of a Work Profile.

Q5: My company phone's Work Profile blocks sideloading. Any way around it?

Do not, and you should not. It is corporate compliance policy; circumventing it may violate your employer's rules. Ask the administrator or use the main space. The commands here are for devices you own and administer.

Q6: Is the number 10 in `pm list users` always the Work Profile?

Not necessarily. 10 is common, but 11, 100 and others occur. Trust the UserInfo name and flags (profile marker) in dumpsys user; never hardcode it.

Q7: Why is the app still in the main space after `pm uninstall --user 10 <pkg>`?

Expected: uninstall is per user too. To remove it from the device entirely, uninstall for every user, or remove the last remaining installation.

Q8: How do I install a Split APK into a second space?

adb install-multiple --user N base.apk split_*.apk, submitting all splits in one commit. Installing base.apk alone often crashes with missing resources. See how to install split APKs.

Q9: After switching to the second space, adb seems to target the main user. What now?

adb shell always connects to the device; it does not follow the UI. --user in the command is what selects the target. If pm list users shows the target user as not running, switch into that space in the UI to start it, then install.

Q10: Should I troubleshoot "multi-user" or "no icon after install"?

pm list packages --user N | grep <pkg> returning output means installed but not shown on the launcher -> no app icon troubleshooting. No output means it was never installed for that user -> this article.

9. Further reading

Bottom line

"Installs in the main space, not in the second space" is almost never an APK problem - it is the inevitable result of Android maintaining installed-app lists per user, or of an install restriction on that user. Three steps do the work: `pm list users` for the real userId, `pm list packages --user N` to see whether it is installed at all, and `dumpsys user` for DISALLOW_INSTALL restrictions. Then either install explicitly with pm install --user N, or accept the policy and use the main space. Keep "dual apps" and "system multi-user" as two separate mechanisms; mixing their diagnostic paths wastes hours.