Difference between adb "install" command and "pm install" command?
34,689
adb install
is a command to run from a development host, which uploads a package somewhere temporary and then installs it.
pm install
is a command to run locally on the device.
adb
does indeed utilize the pm
program on the device - see the source code at
https://android.googlesource.com/platform/system/core/+/kitkat-mr2.2-release/adb/commandline.c
![hackjutsu](https://i.stack.imgur.com/0aQ16.jpg?s=256&g=1)
Comments
-
hackjutsu almost 2 years
What's the difference between installing an app using the
install
command and using the package manager'spm install
command? Do they do the exact same job? Does one command actually call the other in the back?adb install -r APK_FILE adb shell pm install APK_FILE
-
Randall Flagg almost 4 years
-
Chris Stratton almost 4 yearsThe reason this points at a specific revision is that the way things are implemented tends to change between versions, and "head" is not a specific version and so not a stable link eg, what is a .c file today might be a .cpp file next time around, or whatever.
-
LarsH almost 3 yearsSo given that adb does utilize the
pm
program on the device, does that mean it should take all the same command-line options? The behavior I'm seeing is different. For example,adb shell pm install
(on Android 10 device) rejects options like--no-incremental
and--wait
with an error such as "Unknown option --no-incremental." Whereasadb install
gives no such error (but maybe ignores those options).