androidadbsmartphone

How do I restore previously removed android system app with adb?


I'm trying to remove some system apps from my android smartphone to debloat it. I use the following adb command: adb shell pm uninstall package.to.remove. But what if I will want to restore some of these apps? I can make a backup of the apk using adb pull my.package path/i/want. Then I can restore them using adb shell pm install package.to.install. I assume that the apps will be install as user app. So the questions are:


Solution

  • If you're using pm uninstall rather than pm uninstall -k --user 0 com.package.name, I'm asuming that you have root access. If that's the case, then its better/safer to use pm disable because you could enable them anytime with pm enable. If you're talking about some "non-necessary" apps, but not a system component, then yes you can uninstall them. But be careful doing that. Do your research on the app before uninstalling them, because it could lead you into boot loop. Make sure to keep backups of your apps if possible, if something goes wrong, you could copy them back again to their directories. If you have root privilege, then yes, copying the apps back to their original place will retain their functionality. But if you try installing them without root, just as a user or using adb install, the apps will no longer be a system app, and most probably will be useless since they are already in the system, just disabled/uninstalled for the current user. A factory reset will reset all the apps like before. Hope this helps (: