Removing Bloatware From Android with Help of Linux

What is Bloatware?

Bloatware is a type of software that comes preinstalled on a computer, smartphone, or tablet. It takes up space, reduces battery life, and cripples performance. Annoying at best, harmful at worst, bloatware is rarely useful and serves primarily as a revenue stream for manufacturers and distributors.

How to remove them?

Caution

Read about the package before removing and try not to mess with system critical apps like your default home launcher.

Most bloatware can be uninstalled easily like how we uninstall regular apps. In some cases, you won’t be able to completely remove an app because of the way the manufacturer has integrated it into its own version of Android. If this is the case, look for an option labeled Disable instead of Uninstall—this will at least prevent the app from running, using up vital system resources, and getting in your way.

But we are not happy with this!! We want to completely remove apps rather than disabling them.

Note : The method described here gives your PC a fair bit of power over your Android phone, so don't try to run command you don't know. This is not just for uninstalling an App on your phone. It is also important that you only connect your mobile phone to a computer you trust.

Setup on Linux

To do this we need only one command line tool and that is ADB (Android Debug Bridge).

To install it on Debian/Ubuntu:

sudo apt install android-tools-adb

To install it on Arch:

sudo pacman -S android-tools

After installing check it by running

❯ adb version
Android Debug Bridge version 1.0.41
Version 31.0.3p2-android-tools
Installed as /usr/bin/adb

Setup on Android

For using adb from your computer you will have to enable USB debugging on your Android device. This can be done by visiting developer options in Android. To enable developer option every device has different steps you could found that by simple google search.
NOTE: Do not mess with option that you don't know in Developer Options

On Samsung device developer option looks something like this.

Connecting Devices

To connect your mobile device and computer with adb you will need an USB cable that both device support.

Starting the abd server

 adb start-server

Start the adb sever on your Linux PC with above command and now you are almost ready to connect!

Allowing your PC to Manage Your Phone via Debugging Mode

After starting the server connect both devices via USB cable. You will get a pop-up like the below screenshot.

This dialog shows your computer’s RSA key fingerprint ID. Tick the box ‘Always allow from this computer’ if you would like to have an easier setup next time, and if you trust the computer this is being connected to (and do not proceed at all if you do not trust this computer), and then click ‘Allow’ if you are ready to proceed.

You will also be presented with one more dialog box, which looks similar to the one you see which will ask for access to your phone data allow that too. It doesn’t showed on mine because I already allowed it.

Next, run below command:

❯ adb devices            
List of devices attached
RZ3N12FJ12N     device

If you get the similar output you are ready to clean your device from bloatware.

Removing Bloatware

Type adb shell and you will get a shell to your android device.

See you can run Linux command on android. Do you know how its possible?? That is because Android uses the Linux kernel under the hood.

When you boot an Android device, the Linux kernel loads just like it would on a Linux distribution. However, much of the other software is different. Android doesn’t include the GNU C Library (glibc) used on standard Linux distributions, nor does it include all of the GNU libraries you’d find on a typical Linux distribution. It also doesn’t include an X server like Xorg, so you can’t run standard graphical Linux applications.

Rather than running typical Linux applications, Android uses the Dalvik virtual machine to essentially run applications written in Java. These applications are targeted at Android devices and the application programming interfaces (APIs) Android provides rather than being targeted at Linux in general.

Also just like Linux first process on Android in also init
image

More about this on another blog, if you want comment!!!
Now back to the topic.

For seeing all installed packages on Android run:

pm list package

image

I will be removing Netflix from my device which is installed as bloatware on my device.

As you can see from above screenshot I don’t have option uninstall Netflix from system setting.

Now to remove this bloatware we have to know its package name we can find this via 2 methods. In first method we can just grep package name from ADB piping the previous command:

pm list package | grep netflix

image

Or you can use this applicationsinfo open source application on F-droid.

Now at last run this command to completely remove the bloatware.

pm uninstall -k --user 0 com.netflix.mediaclient

image

That’s it you have removed your first bloatware now try to remove more.

Caution Again!!

Read about the package before removing and try not to mess with system critical apps like your default home launcher.

2 Likes

Wow, so simple.
Have to remove an app from my phone as a test when I’m back at the computer.
Thanks for the advice :grin:

I like your caution, but I would personally put that on top of the thread.
Debloating is important (especially is you can’t install a secure custom ROM on your device), but should always be handled carefully as some random app might actually be important for your system to run.

Thanks for the suggestions i have edited the post.

Thanks @iamroot for the tutorial. Im thinking of trying it since I do not have a phone where I can install a custom rom . Could the method above be used to remove all google services on a stock android phone and then using microg?

1 Like