LinuxCommandLibrary

dumpsys

Diagnose Android system services status

SYNOPSIS


dumpsys [options] [SERVICE [ARGUMENTS]]

PARAMETERS

SERVICE
    Specifies the name of the system service to dump. If omitted, `dumpsys` dumps information from all available services. Common examples include `activity`, `battery`, `meminfo`, `wifi`, `power`, `input`, `window`, etc.

ARGUMENTS
    Optional arguments specific to the chosen `SERVICE`. Many services support `-h` or `--help` to display service-specific options. Other common arguments include `--checkin` for machine-readable output or `-a` for all information (e.g., with `meminfo`).

-l
    Lists all available system services that `dumpsys` can query. This is useful for discovering which services can be targeted.

-t TIMEOUT_MS
    Sets a timeout in milliseconds for the dump operation. If the dump takes longer than the specified timeout, it will be aborted, preventing indefinite hangs.

--skip-services SERVICE1,SERVICE2,...
    When dumping all services, this option allows specifying a comma-separated list of services to exclude from the output, useful for reducing verbosity.

--all
    Explicitly requests dumping of all services. This is the default behavior if no `SERVICE` is specified, so it is often redundant but can be used for clarity.

-h or --help
    Displays the top-level usage information for the `dumpsys` command, including available options and basic syntax.

DESCRIPTION

The `dumpsys` command is a powerful diagnostic tool used on Android devices to retrieve detailed information about the state of various system services. It is typically invoked via `adb shell` from a host computer or directly on the device's shell. By default, running `dumpsys` without any arguments will output a massive amount of information about all running system services, including activity management, memory usage, battery stats, network connectivity, display settings, and more. This verbose output makes it an indispensable utility for Android developers, QA engineers, and system administrators to debug performance issues, identify resource leaks, analyze battery drain, and gain deep insights into the device's current operational state. Each system service provides its own specific diagnostic data, making `dumpsys` a versatile tool for troubleshooting a wide array of Android-specific problems.

CAVEATS

The output of `dumpsys` is typically very verbose and unstructured, often requiring piping through command-line tools like `grep`, `less`, or redirection to a file for effective analysis. Its output format can vary between Android versions and device manufacturers, making parsing challenging. Understanding the meaning of specific output lines often requires deep knowledge of Android internals. `dumpsys` is an Android-specific command and is not part of standard Linux distributions.

COMMON USAGE PATTERNS

The command is most frequently used with specific service names to narrow down the diagnostic output. Common examples include:
adb shell dumpsys activity: Dumps information about the Activity Manager, including task stacks, recent activities, and process states.
adb shell dumpsys battery: Provides detailed battery statistics, including current level, health, temperature, and historical power usage.
adb shell dumpsys meminfo package_name: Shows memory usage for a specific application or all processes, helping identify memory leaks or excessive consumption.
adb shell dumpsys gfxinfo package_name: Dumps graphics performance statistics for an app, useful for diagnosing UI jank and rendering issues.
adb shell dumpsys wifi: Displays Wi-Fi service state, configured networks, connection statistics, and scan results.
Often, the output is piped to `grep` to filter for specific lines, e.g., `adb shell dumpsys battery | grep 'level'` to quickly find the battery percentage.

HISTORY

`dumpsys` has been a fundamental diagnostic utility within the Android operating system since its early development stages. Its evolution has closely paralleled the growth of Android itself, with new system services gaining `dumpsys` capabilities as the OS expanded in features and complexity. While its core function of querying system service states has remained consistent, the breadth and depth of information it can provide have significantly increased over time, solidifying its role as an indispensable tool for Android development and debugging.

SEE ALSO

adb(1), logcat(1), pm(1), am(1)

Copied to clipboard