Mention the specific user as an argument for which the package is to be installed. Example:
adb install --user UID YOUR_APK
adb shell pm install --user UID YOUR_APK # alternative command
UID for main/primary user is always 0.
Sidenote: in case of difficulty with an adb command, simply enter adb as the sole command. It would list help section.
If it's just the APK files, you could use the getapk script provided in the tools/ directory of my little helper Adebar, calling it e.g. with getapk user to retrieve all user-installed apps. You won't be interested in system apps, but for completeness:
Extracting APK files from a connected device.
getapk lets you extract a single app's APK, ...
mksh developer here.
mksh uses UTF-8 internally, but is currently limited to the BMP (basic multilingua plane), which means U+0000 to U+FFFD. If you want to use SMP codepoints (U-00010000 to U-0010FFFD) on the input line, you currently have to disable the UTF-8 mode (sorry):
$ set +U
That switches to a byte-wise mode which does not limit the input. (You can ...
I found the reason in logcat while performing an backup:
BackupManagerService: Package com.android.chrome is key-value.
By default for abd backup keyvalue backups are disabled:
"/system/bin/bu" (the command that is called on-device by adb backup) help text:
-keyvalue|-nokeyvalue: include apps that perform key/value backups.
The cause was surprising, but poor error reporting even more frustrating. My devices is connected using USB, passed through to a VM. It seems USB timing issues cause the connection to be intermittent or out of spec. But not enough to cause an error in system log.
abd do not complain about the latency or loss of connection, just quietly died with error 1. ...
Since this adb server version (XX) doesn't match this client (YY); killing... seems to be a very prominent question, let me present the quite straight forward solution - I actually wonder why it wasn't answered anywhere else or at least, I couldn't find it. To find the version of ADB you are using, type adb version to get something like:
Android Debug Bridge ...
For those who are trying to install XAPK files through adb because their XAPK Installer does not work on their Android phone, I've got you covered.
You must have Android Debug Bridge (ADB) set up and working.
XAPK files are basically ZIP Archive files (described by their PK header at the beginning of the file)
This means we are able to open/extract those ...