Skip to content

thienandangthanh/uninstall-android-apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Remove or Disable Android Apps via ADB

This script allows you to remove or disable pre-installed or unwanted apps from your Android device using ADB. It automates the process by:

  • Starting the ADB server.
  • Ensuring the device is authorized.
  • Checking if apps are installed before attempting to uninstall or disable them.
  • Trying to uninstall the app first; if that fails, disabling it.

Prerequisites

Ensure that ADB (Android Debug Bridge) is installed on your system. Below are the installation instructions for different Linux distributions:

Arch Linux

sudo pacman -S android-tools android-udev

Read more: ArchWiki - Android Debug Bridge

Debian/Ubuntu

sudo apt update
sudo apt install android-tools-adb

Fedora

sudo dnf install android-tools

Other Linux Distributions

Install the adb package using your package manager or download the Android SDK Platform Tools from the official website.

Usage

  1. Clone or download the script:

    git clone https://github.com/thienandangthanh/uninstall-android-apps.git
    cd uninstall-android-apps
  2. Make the script executable:

    chmod +x uninstall.sh
  3. Connect your Android device via USB and enable USB Debugging from the Developer Options.

  4. Run the script:

    ./uninstall.sh

Script Behavior

  • The script will:
    1. Start the ADB server if not already running.
    2. Prompt you to authorize your computer if your device is not already trusted.
    3. Attempt to uninstall each app listed in the script for the current user (pm uninstall --user 0).
    4. If uninstallation fails, it will disable the app (pm disable-user --user 0).

Customizing the Script

  • Open the script in a text editor:

    vim uninstall.sh
  • Modify the apps_to_remove array to include the package names of the apps you want to process:

    apps_to_remove=(
        "com.example.app1"
        "com.example.app2"
    )

Enabling Disabled Apps

If you need to re-enable an app that was previously disabled:

  1. Check the list of disabled apps:

    adb shell pm list packages -d
  2. Enable the desired app:

    adb shell pm enable com.example.app
  3. To enable all disabled apps:

    adb shell pm list packages -d | awk -F':' '{print $2}' | while read pkg; do adb shell pm enable "$pkg"; done

Troubleshooting

  • If no device is detected, ensure USB Debugging is enabled and run:

    adb devices

    Authorize the computer if prompted.

  • If the app is critical or part of the system, it may not be removable or disable-able without root access.

Disclaimer

  • Use this script with caution. Removing or disabling critical system apps may cause unexpected behavior on your device.
  • This script is provided as-is without any warranty.

About

Remove or Disable Android Apps via ADB

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages