SoFunction
Updated on 2025-04-14

Detailed explanation of the adb command of the Android application package

The adb command for Android application package

adb (full name Android Debug Bridge) is a C/S architecture command line tool that plays the role of a debugging bridge and is a bridge connecting Android phones to PCs, making it easier for us to operate the phone on the computer. The adb command can be used to perform various device operations, such as installing and debugging applications.

  • View package names for all installed applications
    • Orderadb shell pm list packages
    • illustrate: This command lists the package names of all installed applications on the device. Can be passed through the pipe symbol|CombinedgrepCommands to filter specific package names, e.g.adb shell pm list packages | grep , this will only display the package name containsApplication.
  • View application details
    • Command: adb shell pm dump
    • Description: This command is used to obtain detailed information about the specified application package, including the application's installation location, permissions, components, etc.
  • Install the application
    • Command: adb install <path_to_apk>
    • Description: Install the .apk file of the specified path to the device. If you want to overwrite an existing application that is installed, you can use the -r parameter, that is, adb install -r <path_to_apk>.
  • Uninstall the app
    • Command: adb uninstall
    • Description: Uninstall the application with the specified package name on the device. If you want to keep the data and cache of the application, you can use the -k parameter, that is, adb uninstall -k, so that the data and cache of the application will remain on the device after uninstallation.
  • Clear application data and cache
    • Command: adb shell pm clear
    • Description: This command clears all data and caches of the specified application, which is equivalent to manually clearing application data and caches in the device's application settings.
  • List the permissions for the application
    • Command: adb shell pm list permissions -d -g -f
    • Description: This command is used to list the permissions declared by the specified application, including the name of the permissions, protection level, etc. Parameter -d means only dangerous permissions are displayed, -g means listing permissions by group, and -f means displaying the flag bit.

This is the end of this article about the adb command of the Android application package. For more related content of Android adb command, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!