LinuxCommandLibrary

adb-shell-pm-list

List installed Android packages

TLDR

List all installed packages

$ adb shell pm list packages
copy

Print all users on the system
$ adb shell pm list users
copy

Print all known permission groups
$ adb shell pm list permission-groups
copy

Print all known permissions
$ adb shell pm list permissions
copy

List all test packages
$ adb shell pm list instrumentation
copy

Print all features of the system
$ adb shell pm list features
copy

Print all the libraries supported by the current device
$ adb shell pm list libraries
copy

SYNOPSIS

adb shell pm list [options] [arguments]

Common Subcommands and their syntax:
adb shell pm list packages [options] [FILTER]
adb shell pm list permission-groups
adb shell pm list permissions [options]
adb shell pm list instrumentation
adb shell pm list features
adb shell pm list libraries
adb shell pm list users

PARAMETERS

General Options (applicable to some subcommands):
    These options modify the behavior of specific pm list subcommands.

packages
    Lists all installed packages on the device.

-f
    Show the associated APK file for each package.

-d
    Filter to only show disabled packages.

-e
    Filter to only show enabled packages.

-s
    Filter to only show system packages.

-3
    Filter to only show third-party packages.

-i
    See the installer for the package.

-u
    Also include uninstalled packages (that still have data). Requires Android 7.0+.

--user
    The user space to query. Lists packages for a specific Android user profile.

[FILTER]
    Filter packages whose name contains the specified text.

permission-groups
    Lists all known permission groups on the device.

permissions
    Lists all known permissions on the device.

-g
    Group permissions by their respective permission groups.

-f
    Print all available information for each permission.

-d
    List only dangerous permissions (requiring user consent).

-u
    List only 'undreamed' permissions (not granted to any package).

-s
    List only system permissions (part of the Android OS).

-p
    List permissions used by a specific package.

instrumentation
    Lists all known instrumentation components (for testing/monitoring) on the device.

features
    Lists all hardware and software features supported by the device.

libraries
    Lists all shared libraries available on the device.

users
    Lists all user profiles configured on the device.

DESCRIPTION

adb shell pm list is a powerful command executed on an Android device via the Android Debug Bridge (ADB). It provides comprehensive functionalities for listing various components managed by the device's Package Manager (pm). This command is indispensable for developers, system administrators, and advanced users who need to inspect installed applications, permissions, features, and other system-level details on an Android device. It allows filtering results based on criteria like package status (enabled/disabled, system/third-party), user ID, and text filters, making it easy to diagnose issues, review security configurations, or simply get an overview of the device's software environment.

CAVEATS

This command requires an active adb connection to an Android device or emulator. The output and available options might vary slightly depending on the Android version and device manufacturer. Access to certain detailed information might be restricted without root privileges. Interpreting the output, especially for permissions and packages, is crucial for effective device management and security auditing.

COMMON USE CASES


• Identifying the package name of an installed application (e.g., adb shell pm list packages | grep "myapp").
• Checking which applications are disabled or enabled on the device.
• Reviewing dangerous permissions granted to specific applications or overall permissions present on the device.
• Inspecting system features (e.g., NFC, camera capabilities) or shared libraries available on a particular device model.
• Listing all user profiles configured on a multi-user Android device.

PERMISSIONS AND SECURITY

While adb shell pm list generally doesn't require root privileges for basic listing operations, some detailed information (especially for sensitive system packages or permissions) might be restricted depending on the Android version and device configuration. Understanding the output, particularly for permissions, is vital for security auditing and ensuring applications adhere to the principle of least privilege.

HISTORY

The pm (Package Manager) command-line tool has been an integral part of the Android platform since its early versions, providing a crucial interface for managing applications and their components. Its list subcommand evolved to offer increasingly granular control and visibility into the device's software environment, adapting to new Android features like multi-user support, runtime permissions, and modular system components. It remains a fundamental tool for diagnostics, development, and security auditing on the Android OS.

SEE ALSO

adb(1), pm(8) (Android Package Manager), am(8) (Android Activity Manager), dumpsys(8) (Android System Service Dump)

Copied to clipboard