[Samsung Galaxy S20 / S20+ / S20 Ultra Guides, News] amnesiadroid:
Hi, i´ve seen some threads and questions about debloating in the s20 forum, but by having a quick look at them, theres not much information for beginners. Thats why I decided to sign up and join the xda community. I would like to make this the discussion thread for debloating related stuff, packed with all information needed and want you guys to join and share. I´m rooting, debloating my devices with passion since Galaxy S2 for various reasons, my main drive to do so is privacy among others.

Some people might ask: Why use adb to debloat when there are debloating apps in the play store?

Simple, the advantage of using adb is, its a built-in android feature, no need for apps that are loaded with trackers and analytics. You can simply generate your own debloat list.txt and store it on your computer, this is what i advise everybody to do, in case you break something you´ll have the list of what you did and you can work with it. It´s also very useful to have your own list in case you switch roms, reflash rom or had to factory reset for whatever reason. In this case just copy & paste your list in the terminal hit enter, reboot, boom your done. Simple, fast and effective, with an app you´ll have to debloat every app one by one, which is very time consuming. However package manager have their use case, especially when you´re on the run and want to enable/disable an app.

When uninstalling apps via adb, the package still remains in its directory and is not deleted from its partition, it simply gets uninstalled/unlinked from your user account. This has the advantage you can easily reinstall them by adb in case you broke a feature but it also means you won´t free up space by doing so unless you use the right uninstall command to at least delete the /data and /cache directory. (For the paranoid people out there, the uninstalled apps wont do nothing, no background activity, internet/dns requests or whatever, they are dead by using the pm uninstall -k --user 0 command)

This all sounds perfectly safe and easy, but it isn't. pm uninstall still is a powerful command that can uninstall system apps and by doing so it can mess up your system. If you uninstall the wrong system app and your stuck in a bootloop or the system doesn´t boot at all, the game will be over but you can´t hard brick your device. If you´re able to establish an adb connection while booting simply reinstall the troublemaker. If you can´t connect while booting, factory reset, wipe data/cache is the way to go or reflash firmware with CSC not HOME_CSC! If you don´t know what you´re doing then do some research before uninstalling system apps, always have a recent backup, in case something goes wrong.

disabling or uninstalling?

i prefer uninstalling. A disabled app, can still be seen by other apps and i don´t want that. It´s even possible to disable an system app and your system will run perfectly fine, but when uninstalling the app your system won´t boot anymore.

I go with uninstalling, but thats just personal preference. You can always play safe and disable.

You will still receive OTA updates and uninstalled apps stay uninstalled after the update, but it´s better to check after every update, there could be changes made to the update and/or additional bloat could be installed. better be safe than sorry.

YOU DON´T NEED ROOT FOR THIS, you can disable/uninstall apps via adb without rooting your device. You will not trip knox or risk your warranty, by doing so. This is most likely the best part for the most users out there.

Something to note is, that some system apps reinstall themselves after a reboot. Thats the limit of pm uninstall command, because it won´t remove the package from the system dir. In case you want that system app removed, you´ll have to remove that package with a root file explorer a root package manager. But be warned, your playing with fire. I´ll mention known packages that show this behaviour down below the list and if it´s possible to get rid of them.

If you find yourself in the situation where you really have to delete packages from /system because it´s mandatory (microG) for what you´re going to mod, i recommend Debloater (Terminal Emulator) from Magisk repository along with Termux. Of course your device needs to be rooted to modify system, but if you get this far you are already rooted.

edit:

race conditions caused Debloater magisk module to not work as intended with my setup and microG, if you're experiencing problems remove packages with a root file manager and back them up manually if needed.

what you need:

- a computer, if you´re on a linux machine you´re a lucky bastard ;) just download the latest android platform tools from your repository, you might have to enable AUR, depending on your distro. install it and your set to go.

- if you´re on a windows machine (commands maybe a little different), you´ll need adb and drivers. I´m a linux user, i have no experience with adb and windows, so if you might have, hit me up and explain whats needed with a link. I´ll happily add it here to make it easier for beginners.

- a usb cable with data connection, the original charging cable is fine

- activated USB debugging in developer settings. activate developer settings: go in to your system settings/phone info/software info/ hit buildnumber a couple times. this will activate the developer settings found in settings/ search for usb-debugging and activate it.

Note: don´t forget to disable usb-debugging after you´re finished and tested your system thoroughly, as leaving this activated is a security concern.

Let´s start with some useful commands related to adb debloat, type in your terminal:

adb shell

- this will connect your device after you confirmed the connection on your phone

pm list packages

- will show you all installed packages

pm list packages | sort

- will show you all installed packages sorted

pm list packages google

- will show you all packages with google in it, or for example: pm list packages samsung, will show you all packages with samsung in its name

dumpsys package package.name.example

- this will show you more information about the package

###

pm uninstall -k --user 0 package.name.example

- this will uninstall the package for you (--user 0) but it will keep (-k) its /data and /cache directories, (app updates won´t get removed)

pm uninstall --user 0 package.name.example

- this will uninstall the package for you (--user 0) and will delete the /data and /cache directories, app updates will get deleted. this command will free up some space

cmd package install-existing package.name.example

- this will reinstall the uninstalled package

- if you have more user accounts on your device and want to uninstall a package for a specific user just change the --user 0 command to for example: pm uninstall -k --user 1 package.name.example

###

pm disable-user --user 0 package.name.example

- this will deactivate the package

pm enable --user 0 package.name.example

- will activate the package again

pm list packages -d

- will show you disabled packages

- if you have more user accounts on your device and want to disable a package for a specific user just change the --user 0 command to for example: pm disable-user --user 0 package.name.example

###

reboot

- will reboot your device

this is just a tiny fraction of adb commands, to not make it more complicated than it is... you´ll mostly need the pm uninstall or pm disable command.

Feel free to use a package manager app to search for apps and their package names, this will give you additional information about the package, for example it´s icon, location path,...

I am using OpenApk from the f-droid store to search for packages or to disable or uninstall them by hand, unfortunately the app is unmaintained since 2 years or so and the uninstallation of apps doesnt work anymore on the S20+/Android 10, but disabling/enabling still works perfectly fine. It´s free, open-source, no tracking, no analytics, requests root for disabling/uninstalling. I also use xprivacylua, to search for apps by app name, package name and even UID, comes very handy. Also free, open-source, no tracking, no analytics, needs root and xposed/edxposed to run.

If these 2 apps don´t work for you, use your favourite package manager app.