adb-shell-pm-list-packages
List installed Android packages
TLDR
List all installed packages
List all packages and their associated APK file paths
Only list disabled packages
Only list enabled packages
Only list system packages
Only list third-party (non-system) packages
Show the installer for each package
SYNOPSIS
adb shell pm list packages [options] [<FILTER>]
PARAMETERS
-f
Displays the full path to the APK file for each package.
-d
Filters the list to show only disabled packages.
-e
Filters the list to show only enabled packages.
-s
Filters the list to show only system packages.
-3
Filters the list to show only third-party (non-system) packages.
-i
Displays the installer package name for each listed package.
-u
Includes uninstalled packages that still have data directories.
--user <USER_ID>
Lists packages for a specific Android user profile, identified by USER_ID.
<FILTER>
A string to filter package names. Only packages containing this substring will be listed (case-insensitive).
DESCRIPTION
The `adb shell pm list packages` command is a fundamental tool for Android developers and power users. It leverages the Android Debug Bridge (adb) to execute the Package Manager (pm) utility directly on a connected Android device or emulator. Specifically, the `list packages` subcommand is used to retrieve a comprehensive list of all installed application packages on the device. This command is invaluable for debugging, managing applications, and understanding the software environment of an Android system.
It allows users to identify package names for various operations like uninstalling specific apps, checking for pre-installed system apps, or verifying the installation of third-party applications. The output typically lists package names in the format `package:
CAVEATS
Adb must be correctly installed and configured on your host machine, and the Android device or emulator must have USB debugging enabled and be authorized for connection. Without these prerequisites, the command will fail or not find any devices.
The output for devices with many apps can be very long; it's often useful to combine this command with filtering options or pipe its output to tools like `grep` to manage the volume of information.
OUTPUT FORMAT
The command typically outputs package names in the format `package:
COMMON USAGE PATTERNS
This command is frequently used as a precursor to other operations. For instance, `adb shell pm list packages | grep 'my_app'` to quickly find a specific package, or `adb shell pm list packages -3` to identify all user-installed applications for potential bulk uninstallation or backup. The output can be piped to `xargs` for batch operations on packages.
HISTORY
The Android Debug Bridge (adb) and its associated shell commands, including the Package Manager (pm), have been integral parts of the Android SDK since its early releases. `pm list packages` has consistently provided a crucial interface for developers and system administrators to inspect the installed software on Android devices. Its evolution has largely focused on adding more filtering capabilities (like `--user`) to adapt to the growing complexity of Android, including multi-user support and stricter security models. Its widespread use underscores its importance in the Android development and maintenance ecosystem.


