LinuxCommandLibrary

adb-shell-pm-list-packages

List installed Android packages

TLDR

List all installed packages

$ adb shell pm list packages
copy

List all packages and their associated APK file paths
$ adb shell pm list packages -f
copy

Only list disabled packages
$ adb shell pm list packages -d
copy

Only list enabled packages
$ adb shell pm list packages -e
copy

Only list system packages
$ adb shell pm list packages -s
copy

Only list third-party (non-system) packages
$ adb shell pm list packages -3
copy

Show the installer for each package
$ adb shell pm list packages -i
copy

SYNOPSIS

adb shell pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [--user USER_ID] [FILTER]

PARAMETERS

-f
    Show APK file path for each package

-d
    List only disabled packages

-e
    List only enabled packages

-s
    List only system packages

-3
    List only third-party packages

-i
    Show installer package name for each

-u
    Include uninstalled but cached packages

--user USER_ID
    List packages for specific user ID

DESCRIPTION

The adb shell pm list packages command retrieves a list of all installed applications (packages) on a connected Android device or emulator. ADB, the Android Debug Bridge, enables shell access to the device, where pm (Package Manager) is invoked to query the system's package database.

This utility is essential for developers, testers, and administrators to inspect app installations, verify deployments, debug issues, or automate inventory tasks. By default, it outputs fully qualified package names (e.g., package:com.google.android.chrome), one per line.

Options provide filtering by status (enabled/disabled), origin (system/third-party), and more, along with details like APK paths or installers. A filter string can limit results to matching package prefixes. It's non-destructive, reads-only, and works over USB or Wi-Fi with ADB enabled.

Common use cases include scripting app detection, monitoring bloatware, or integrating into CI/CD pipelines. Requires USB debugging enabled on the device and ADB from Android SDK platform-tools.

CAVEATS

Requires ADB installed, device with USB debugging enabled, and authorized ADB connection. FILTER is a prefix match; multi-user devices need --user for accuracy. Not for production use without safeguards.

EXAMPLE USAGE

adb shell pm list packages -s
Lists system packages only.

adb shell pm list packages | grep facebook
Filters for Facebook-related apps.

OUTPUT FORMAT

Lines prefixed with package: followed by name, e.g.,
package:com.android.settings
With -f: package:/system/app/Settings.apk=com.android.settings

HISTORY

Part of Android SDK since Android 1.0 (2008); pm evolved with multi-user support in Android 4.2 (2012) and options refined in later releases like Android 10+ for scoped storage.

SEE ALSO

adb(1), pm(8), aapt(1)

Copied to clipboard