How to remove several applications using a script?

Hello everyone.
Please tell me how to remove several programs that I do not use, I want to replace them with F-droid programs.

I used to make a script like this:

#! /bin/bash

adb root

adb remount


rm -R /system/app/Notes
rm -R /system/app/Mail

If I am not mistaken, now you can use

$ adb shell su -c rm -R /system/app/Notes

And how to remove several? Thanks in advance for your help!

You don’t need root to uninstall system apps.
Just do.

adb uninstall --user 0 <package-name>

for an example this uninstalls google play store.

adb uninstall --user 0 com.android.vending

You can list packages names with the following command

pm list packages -s

-s lists only system packages

Note that your system partition will remain as it is (You can’t modify it as it’s mount as read-only) Andoid will just act as if the apps where uninstalled.
To reinstall a system app do

cmd package install-existing <package-name>

You can use App manager from F-Droid to uninstall system apps using root or wireless adb using the GUI.

DON’T write a bash script that uninstalls any package which has google in it. I did it and my phone suddenly restarted and started bootlooping.
Be cautious about what you uninstall.

3 Likes

Android apps

1 Like

@shuvashish76 @Ammar64 Hi. Do I understand correctly that all these programs correctly disable applications, and do not delete them?

I checked them, for example in De-Bloater | F-Droid - Free and Open Source Android App Repository and App Manager - Android package manager | F-Droid - Free and Open Source Android App Repository the interface says delete, ok I clicked delete, the applications disappeared from the phone’s desktop, but in fact their directories remained in place.

And in the application "
universal-android-debloater" there is no inscription delete, I see disable.

Reference:

AM matrix room: https://matrix.to/#/#appmanager:matrix.org if you’ve more queries.

1 Like

Thank you very much for the information, I will go to their channel, but in this case it is not about the terms, but about the fact that none of these programs that you recommended removes the program from the phone, but disables it correctly. The programs are good!

You can check this yourself. For example, you want to remove the system program in your phone “Notes” or “Browser” which, depending on your phone and operating system, are located here:

$ cd /system/app/Notes/Notes.apk 
$ cd /system/product/app/Browser/Browser.apk 

You use these three programs: AppManager, De-Bloater, universal-android-debloater (GUI for PC)

then you can check how the program was removed, go to these directories using the terminal and root rights and you will see that the Notes.apk and Browser.apk files are in the same place where they were.

And I’m talking about deleting the directory with the program, which is a more reliable method

# rm -R /system/app/Notes
# rm -R /system/app/Browser