Local equivalent to adb install 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)?
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.