How to disable Android system applications without root access

Image: Pixabay

While trying to delete the preloaded applications to debloat my phone, I have seen that some of the bloatware were system applications.

After reading this article on XDA-Developers website about uninstalling Android system applications without root Access, I have been looking for an alternative option like disabling a system application at user level.

I started with downloading and installing the phone software (drivers) and Miniamal ADB and Fastboot to my computer. I have connected the phone to the computer and enabled USB debugging on phone. (To enable USB debugging, enable Developer options first. Go to Settings -> About phone, tap Build number 7 times to enable Developer options. Go back and go to Developer options -> Enable USB debugging.)

 

After running “Minimal ADB and Fastboot” from the Start menu (type Minimal and let Windows search), everything was ready to send adb commands.

The uninstall procedure mentioned in the article was clever as it was written to uninstall a system application for a specific user without root access.

adb shell pm uninstall -k --user 0 <packagename>

Uninstalling a system appllication can be dangerous as it is irreversible. Uninstalling a system application requires root permissions. With the help of “-k –user 0” parameters, a system application can be uninstalled for the current user without root access. If a system application is uninstalled for the current user, it can come back after a factory reset and also OTA updates are not afected. By uninstalling a system application for the current user, you simply get rid of the application, remove it from menus, you save some resources but not save space.

In my opinion, disabling a system application instead of uninstalling is a better option for most situations. A disabled app can be re-enabled without a factory reset. Results are similar. If you disable a system application for the current user, it is removed from launcher but not removed from application list in settings and marked as “disabled”. While disabling a system application requires root access, disabling a system application for the current user does not need root access.

Well, this is the formula:

# Disable the system application for the current user with package manager
adb shell pm disable-user <packagename>
# After disabling an app, you can force stop it using activity manager if it is still running
adb shell am force-stop <packagename>

“disable-user” parameter also accepts –user parameter and have a better use case that I will explain below.

A disabled application can be re-enabled with a simple command.

adb shell pm enable <packagename>

After I have disabled and force-stopped some applications on my test device, Huawei P10 Lite running stock EMUI 8 Android Oreo, I have realized that some apps were still be running after rebooting device. I will continue explaining with Facebook App Manager as an example which survives after reboot.

To get users I give the following command:

adb shell list users

and get the output:

Users:
    UserInfo{0:Owner:13} running
    UserInfo{10:─░kiz:4000010} running

Actually, it is probably for Huawei’s “clone app” thing and you may not need the commands below unless you have the same situation. It was running and I have managed to control it with “pm disable-user”.

After listing users, I have used the same command with –user parameter for the two user IDs listed (0 and 10).

adb shell pm disable-user --user 0 com.facebook.appmanager
adb shell pm disable-user --user 10 com.facebook.appmanager
adb shell am force-stop com.facebook.appmanager

And it worked! The app was not surviving after reboot. So, I have determined an alternative method for my situation: Get user IDs using the method described above. Call disable-user with –user parameter for the user IDs listed (0 and 10 here). Force-stop the application at last.

adb shell list users
adb shell pm disable-user --user 0 <packagename>
adb shell pm disable-user --user 10 <packagename>
adb shell am force-stop <packagename>

Determining apps to disable

Disabling a system application does not always mean that you are saving resources or battery power. Things can be worse than ever. i.e.: Your device can be unusable. i.e.: A system application that regularly tries to launch another system application, that you already disabled, can leech your battery power. To see if everything goes well, you can try and also you can see system logs.

You should disable a system application only if you do not want to see it around anymore and you know what you are doing.

You can find out package names with the following method:

# List all packages
adb shell pm list packages

# Find packages that contain "facebook" in their names
adb shell pm list packages facebook

Debloating my test device, Huawei P10 Lite running EMUI 8 Android Oreo

I did not examine the system logs but by disabling the following packages on my device (for testing purpose only), I did not noticed a performace change on battery life.

# Facebook crap. Not the facebook app from Google Play Store.
com.facebook.services
com.facebook.system
com.facebook.appmanager
# HiCare app, I have never used it before…
com.huawei.phoneservice
# Google Duo app
com.google.android.apps.tachyon
# The default weather app that I don’t use
com.huawei.android.totemweather
com.huawei.android.totemweatherwidget
com.huawei.android.totemweatherapp
# Huawei app market, not available in my country
com.huawei.appmarket
# Idiot EMUI calculator, I prefer the Google one
com.android.calculator2

And, of course, the STK application that I have disabled to get rid of operator popup spam. Click here for the story.

com.android.stk

Source: https://volkan.xyz

 

You can share this blog post only by giving appropriate credit as described at Terms & Conditions.

 

Leave a Reply

Your email address will not be published. Required fields are marked *