Local equivalent to adb install

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

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:

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.

October 09, 2019 12:07 PM

Related Questions

Installation of R packages in Termux app

Updated August 07, 2017 11:11 AM

How to install android from my Computer terminal?

Updated November 26, 2016 07:15 AM

which termux package provides the "mount" command?

Updated April 13, 2017 17:11 PM

Cannot install ffmpeg with Termux

Updated October 07, 2016 09:04 AM

“agrep” for Android Terminal?

Updated July 22, 2019 20:11 PM