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)?
adb shelldoesn't need root access which is a big step for majority of the users. So you can't say them equivalent, but both are commandline solutions. Btw there are workarounds to runadb shellon device. – Irfan Latif Oct 09 '19 at 17:54pm installis equivalent in that it installs APKs and is capable of downgrading, just likeadb install. It is true, though, thatpmrequires root whileadb installdoesn’t.adb shelljust gets you a command line, which is the same thing that the terminal app does; neither requires root per se. Or did you meanadb install? If you have a way to runadb installon the device itself, without requiring a PC connection, feel free to post this as an answer. – user149408 Oct 17 '19 at 13:50adb installexecutesadb shell pm installat back end, so they are essentially the same thing. Point is to connectadbserver toadbd, then you may execute any commandadb XYZ. See this: https://android.stackexchange.com/a/216474/218526 – Irfan Latif Oct 18 '19 at 00:54pmand localadbdo the trick, each coming with their own prerequisites. Which of these two is easier depends mostly on your local device configuration. – user149408 Oct 22 '19 at 11:07