简体   繁体   中英

How to uninstall updates of an android system app through adb?

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.

  1. Move the system apk from /system/priv-app/ to /sdcard/

  2. Adb uninstall

  3. reboot

  4. move back the system app from /sdcard/ to /system/priv-app/

  5. reboot

My question is, is there a straightforward approach to doing it through adb?

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>

adb uninstall <package-name> should uninstall updates to the system applications. I can confirm that it works on Android 12.

Explanation

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.

Note about readonly partitions

system , 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM