Reputation: 313
So there's my system app and I've sideloaded another apk on top of it. Is it possible through adb to just uninstall the sideloaded apk and have the system app running?
I tried two methods which failed. I am using 4.4
a. Removed the sideloaded app from /data/app folder and rebooted. The system app stayed in its comatose state.
b. Did an adb uninstall (Success) and rebooted. same result.
This slightly convoluted approach did it.
Move the system apk from /system/priv-app/ to /sdcard/
Adb uninstall
reboot
move back the system app from /sdcard/ to /system/priv-app/
reboot
My question is, is there a straightforward approach to doing it through adb?
Upvotes: 2
Views: 15387
Reputation: 1747
adb uninstall <package-name>
should uninstall updates to the system applications.
I can confirm that it works on Android 12.
On Android devices system applications are installed to the read-only partition: usually system
, but it also may be the product
partition.
When these applications receive updates through the PlayStore or other simialr means (not the system updates!), these updates are installed to the userdata
partition (read-write) partition.
adb unintall
simply removes these updates these updates from the userdata
partition (obviously it could not remove anything from the read-only partitions).
Alternatively, if you "factory reset" your devices, it's going to wipe the userdata
partition, so you'll the "stock" versions of the system applications.
readonly
partitionssystem
, product
and some other partitions are readonly
on the user
builds of Android.
user
builds is what you get when you buy your device from a store.
You can, however, build userdebug
or eng
variant yourself, flash it on your device and adb remount
these readonly
partition in readwrite
.
You can read more about building Android here.
Upvotes: 4
Reputation: 6461
Since you installed same package (app) on top, adb package manager probably removed the old system app (same package name).
You can see a list of current apps/pacakges with adb shell pm list packages
If you have the old .apk , you can reinstall with adb install -r <apk>
again. http://developer.android.com/tools/help/adb.html
If you see failed version downgrade, try with -d
like so adb install -r -d <apk>
Upvotes: 4