Local equivalent to adb install

by user149408   Last Updated October 09, 2019 12:11 PM

With a PC connection and adb, I can install packages by running

adb install foobar.apk

There is also an option to downgrade a package to an earlier version and keep data (as long the app itself did not introduce any incompatibilities in the later version):

adb install -r -d foobar.apk

Is there an equivalent local command which I could run from a terminal session (or any other way to downgrade without a PC connection)?



Answers 1


The local pm command can do this. You need the following things:

  • A terminal app. (adb shell will also work, but then you might just as well use adb install).
  • A way to get root permission on the command line (usually su)
  • A copy of the APK on the device, e.g. by downloading it using a web browser.

Open the terminal app, then run:

su
pm install -r -d /sdcard/download/foobar.apk

Command line options are the same as for adb install: -r will replace existing packages, -d will downgrade if necessary.

user149408
user149408
October 09, 2019 12:07 PM

Related Questions


Updated August 07, 2017 11:11 AM

Updated November 26, 2016 07:15 AM

Updated April 13, 2017 17:11 PM

Updated October 07, 2016 09:04 AM

Updated July 22, 2019 20:11 PM