Grimoire-
Command
.es

GNU+Linux command memo

Uninstall Android bloatware

Désinstaller les pubiciels embarqués de force sur votre terminal Android depuis un ordinateur.

1. Forcefully uninstall the system user apps from remote

$ adb shell pm uninstall --user 0 com.facebook.services

1.1. adb shell

This implies that your first got adb shell to work for your device. Using GNU+Linux it may be well packaged in your Artix Linux distribution, or outdated in a Debian stable. In this second case you can download the lastest platform-tools from Google and use platform-tools/adb binary instead. I recommand to add your platform-tools/ folder to your current path to allow scripts to use it : $ export PATH=$PATH:/path/to/unzipped/platform-tools/.

2. Re-install a package removed for a user (--user 0)

$ adb shell pm install --user 0 $(pm dump <package name> | awk '/path/{ print $2 }')

This will locate .apk of the uninstalled package and search for a line starting with its /path/ (as per this StackOverflow answer).

3. What can safely be uninstalled ?

Everything that looks like coming from GAFAM :

com.facebook.*
com.microsoft.*
com.linkedin.android
com.samsung.knox.*
com.samsung.android.voicewakeup
com.google.android.youtube
com.google.android.googlequicksearchbox
com.sfr.android.sfrjeux
com.altice.android.myapps

I got around an hundred packages out of a Samsung Galaxy A3 2017 needing more internal space.

To list your apps :

$ adb shell pm list packages -f