Skip to content

Dumpsys


Dump all available system colors

adb shell dumpsys activity service com.android.systemui/.SystemUIService | grep -A 16 "mSystemColors"

Get a nice output from available options to dump

adb shell dumpsys -l|sed 's/^ /adb shell dumpsys/g;G'

Dump all values with help flag -h

adb shell dumpsys -l |sed 's/^ /adb shell dumpsys/g;s/$/ -h/g;G'

Limit output to data associated with the given app op code

adb shell dumpsys appops--mode [MODE]

Limit output to data associated with the given app op mode

adb shell dumpsys appops--package [PACKAGE]

Limit output to data associated with the given package name

adb shell dumpsys appops--attributionTag [attributionTag]

Limit output to data associated with the given attribution tag

adb shell dumpsys appops--include-discrete

Include discrete ops limited to n per dimension. Use zero for no limit

adb shell dumpsys appops --watchers

Only output the watcher sections

adb shell dumpsys appops --history

Dumpsys powerstats info

adb shell dumpsys powerstats

Dumpsys power info

adb shell dumpsys power

Dumpsys permission options

adb shell dumpsys permission
adb shell dumpsys permission_checker
adb shell dumpsys permissionmgr

Dumpsys password policys

adb shell dumpsys password_policy

Dumpsys Device FeatureS/Perfomance/Tracker/Info etc

adb shell dumpsys phone
adb shell dumpsys thermalservice

Dumpsys usagestats for an app

adb shell dumpsys usagestats com.bankid.bus

Dumpsys procstats

adb shell dumpsys procstats

Dumpsys procstats with full stats

adb shell dumpsys procstats --full-stats

Dumpsys procstats csv-mem normal

adb shell dumpsys procstats --csv-mem norm

Dumpsys Package

adb shell dumpsys package com.android.chrome

Dumpsys Help

adb shell dumpsys -h

Dumpsys Activity Activities

adb shell dumpsys activity

Dumpsys Activity Broadcasts

adb shell dumpsys activity broadcast

Dumpsys Broadcast Stats

adb shell dumpsys activity broadcast-stats

Dumpsys Pending Intent

adb shell dumpsys activity intent

Dumpsys Activity Processes

adb shell dumpsys activity processes

Dumpsys Activity Services

adb shell dumpsys activity services

Dumpsys Activity Asociations

adb shell dumpsys activity asociations

Dumpsys Activity LRU Services

adb shell dumpsys activity lru

Dumpsys Activity binder-proxies stats on binder objects and IPCs

adb shell dumpsys activity binder-proxies

Dumpsys Activity settings currently applied config settings

adb shell dumpsys activity settings

Dumpsys Activity service client-side state

adb shell dumpsys activity service
adb shell dumpsys activity package

Dumpsys Activity all: dump all activities

adb shell dumpsys activity all

Dumpsys Activity top: dump the top activity

adb shell dumpsys activity top

Include all available server state in dump

adb shell dumpsys activity -a

Dumpsys Activity and include client state

adb shell dumpsys activity -c

Dumpsys Activity all limit output to given package

adb shell dumpsys activity -p

Dumpsys Activity all output checkin format, resetting data

adb shell dumpsys activity --checkin

Dumpsys Activity output checkin format, not resetting data

adb shell dumpsys activity -C

Dumpsys All Activitys data

adb shell dumpsys activity --proto
adb shell dumpsys activity --autofill

Dumpsys Activity Help

adb shell dumpsys activity recents

Dumpsys Activity Exit Info

adb shell dumpsys activity exit-info

Dumpsys Activity LMK KILLS

adb shell dumpsys activity lmk

Dumpsys Activity Help

adb shell dumpsys activity recents

Dumpsys Activity Permissions

adb shell dumpsys activity top

Dumpsys Activity

adb shell dumpsys activity top

Dumpsys Activity Top

adb shell dumpsys activity top

List all active services

adb shell dumpsys -l 

List services on older android versions

adb shell dumpsys -l \
|sed 's/^  /      /g'

Dumpsys lock_settings

adb shell dumpsys lock_settings
adb shell dumpsys media.audio_flinger \
|grep -A3 Input 

Show bluetooth índo

adb shell dumpsys bluetooth_manager

Dump phone registry

adb shell dumpsys telephony.registry

Dump GPS Data

adb shell dumpsys dumpsys location

Dump device settings settings

adb shell dumpsys settings

Display Contacts On Sim Card

adb shell dumpsys simphonebook

Show hardware info as thermal stuff for cpu, gpu and battery

adb shell dumpsys hardware_properties
adb shell dumpsys account \
|grep -i com.*$ -o \
|cut -d' ' -f1 \
|cut -d'}' -f1 \
|grep -v 'com$'

Show all notifications listener and so on

adb shell dumpsys notification
adb shell dumpsys|egrep -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"
adb shell dumpsys dumpsys package com.lge.signboard | grep versionName

Check state for screen and figoure how device was unlcked last time

adb shell dumpsys  user

Simulate we just got 1% of battery power left

adb shell dumpsys battery set level 1

Connect AC charger

adb shell dumpsys battery set ac 1

Unplug AC

adb shell dumpsys battery unplug

Disconnect AC charger

adb shell dumpsys battery set ac 0

Connect USB cable

adb shell dumpsys battery set usb 1

Disconnect USB cable

adb shell dumpsys battery set usb 0

After running each of those commands you can reset the battery options using

adb shell dumpsys battery reset

Dump all data for battery

adb shell dumpsys battery

Dump stats for your battery

adb shell dumpsys atterystats 

Erase old stats for battery

adb shell dumpsys batterystats --reset 

Sort Applications By Ram Usag

adb shell dumpsys meminfo
adb shell dumpsys notification | grep NotificationRecord | wc -l 

Get a nice output from dumpsys

adb shell dumpsys -l|sed 's/^ /adb shell dumpsys/g;G'
adb shell dumpsys -l|sed 's/^ /adb shell dumpsys/g;s/$/ -h/g;G'

Run all dumpsys help

adb shell dumpsys appops  -h |sed 's/--/adb shell --/g;s/    /### /g'
adb shell dumpsys appops --op [OP]

Limit output to data associated with the given app op code

adb shell dumpsys appops--mode [MODE]

Limit output to data associated with the given app op mode

adb shell dumpsys appops--package [PACKAGE]

Limit output to data associated with the given package name

adb shell dumpsys appops--attributionTag [attributionTag]

Limit output to data associated with the given attribution tag

adb shell dumpsys appops--include-discrete

Include discrete ops limited to n per dimension. Use zero for no limit

adb shell dumpsys appops--watchers

Only output the watcher sections

adb shell dumpsys appops--history

Dumpsys powerstats info

adb shell dumpsys powerstats

Dumpsys power info

adb  shell dumpsys power

Dumpsys Permission Permissions

adb shell dumpsys permission
adb shell dumpsys permission_checker
adb shell dumpsys permissionmgr

Dumpsys password policyś

adb shell dumpsys password_policy

Dumpsys Device FeatureS/Perfomance/Tracker/Info etc

adb shell dumpsys phone
adb shell dumpsys thermalservice

Dumpsys usagestats for an app

adb  shell dumpsys usagestats com.bankid.bus

Dumpsys procstats

adb shell dumpsys procstats

Dumpsys procstats with full stats

adb shell dumpsys procstats --full-stats

Dumpsys procstats csv-mem normal

adb shell dumpsys procstats --csv-mem norm

Dumpsys Package

adb shell dumpsys package com.android.chrome
adb shell dumpsys package \
    |grep -Eo "^[[:space:]]+[0-9a-f]+[[:space:]]+com.samsung.android.app.telephonyui/[^[:space:]]+" \
    |grep -oE "[^[:space:]]+.*Service"

Dump available activitys on device

adb shell dumpsys package \
    |grep -Eo "^[[:space:]]+[0-9a-f]+[[:space:]]+.*/[^[:space:]]+" \
    |grep -oE "[^[:space:]]+$"
adb shell dumpsys activity|grep -i mCurrentFocus|awk 'NR==1{print $3}'|cut -d'}' -f1

Dumpsys Activity Help

adb shell dumpsys perm

Dumpsys Activity Activities

adb shell dumpsys a

Dumpsys Activity Broadcasts

adb shell dumpsys activity broadcast

Dumpsys Broadcast Stats

adb shell dumpsys activity broadcast-stats

Dumpsys Pending Intent

adb shell dumpsys activity i

Dumpsys Activity Processes

adb shell dumpsys activity p

Dumpsys Activity Out Of Mem

adb shell dumpsys activity o

Dumpsys Activity Services

adb shell dumpsys activity services

Dumpsys Activity Asociations

adb shell dumpsys activity as

Dumpsys Activity LRU Services

adb shell dumpsys activity lru

Dumpsys Activity LRU Services

adb shell dumpsys activity lru

Dumpsys Activity binder-proxies stats on binder objects and IPCs

adb shell dumpsys activity binder-proxies

Dumpsys Activity settings currently applied config settings

adb shell dumpsys activity settings

Dumpsys Activity service client-side state

adb shell dumpsys activity service
adb shell dumpsys activity package

Dumpsys Activity all: dump all activities

adb shell dumpsys activity all

Dumpsys Activity top: dump the top activity

adb shell dumpsys activity top

Include all available server state in dump

adb shell dumpsys activity -a

Dumpsys Activity and include client state

adb shell dumpsys activity -c

Dumpsys Activity all limit output to given package

adb shell dumpsys activity -p

Dumpsys Activity all output checkin format, resetting data

adb shell dumpsys activity --checkin

Dumpsys Activity output checkin format, not resetting data

adb shell dumpsys activity -C

Dumpsys All Activitys data

adb shell dumpsys activity --proto
adb shell dumpsys activity --autofill

Dumpsys Activity Help

adb shell dumpsys activity recents

Dumpsys Activity Exit Info

adb shell dumpsys activity exit-info

Dumpsys Activity LMK KILLS

adb shell dumpsys activity lmk

Dumpsys Activity Help

adb shell dumpsys activity recents

Dumpsys Activity Permissions

adb shell dumpsys activity top

Dumpsys Activity

adb shell dumpsys activity top

Dumpsys Activity Top

adb shell dumpsys activity top

List all active services:

adb shell dumpsys -l 

List services on older devices via command below

adb shell dumpsys -l |sed 's/^  /      /g'

Dumpsys lock_settings

adb shell dumpsys lock_settings
adb shell dumpsys media.audio_flinger \
 |grep -A3 Input 

Show bluetooth macaddr, bluetooth name and such things

adb shell dumpsys bluetooth_manager

Dump phone registry

adb shell dumpsys telephony.registry

Dump GPS Data

adb shell dumpsys dumpsys location

Dump Settings

adb shell dumpsys settings

Display Contacts On Sim Card

adb shell dumpsys simphonebook

Show hardware info as thermal stuff for cpu, gpu and battery

adb shell dumpsys hardware_properties
adb shell dumpsys account|grep -i com.*$ -o|cut -d' ' -f1|cut -d} -f1|grep -v 'com$'

Show all notifications listener and so on

adb shell dumpsys notification
adb shell dumpsys |egrep -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b"
adb shell dumpsys dumpsys package com.lge.signboard | grep versionName

Check state for screen and figoure how device was unlcked last time

adb shell dumpsys user

Battery

Simulate battery parameters Simulate battery parameters

Do you have any idea about how to discharge the AVD battery yet? 🔋 Probably not if it is a virtual device with no real battery. But fortunately we can use the following command to simulate any scenario we want, like setting the level to 1% only

Simulate we got 1% Battery

adb shell dumpsys battery set level 1

Connect AC charger

adb shell dumpsys battery set ac 1

Disconnect AC charger

adb shell dumpsys battery set ac 0

Connect USB cable

adb shell dumpsys battery set usb 1

Disconnect USB cable

adb shell dumpsys battery set usb 0

After running each of those commands you can reset the battery options using

adb shell dumpsys battery reset

And for example, you can dump data for all of the running services, dump all data for battery

adb shell dumpsys battery

Dump stats for your battery

adb shell dumpsys atterystats 

Erase old stats for battery

adb shell dumpsys batterystats --reset 

Sort Applications By Ram Usag

adb shell dumpsys meminfo

Unplug AC

adb shell dumpsys battery unplug
adb shell dumpsys notification | grep NotificationRecord | wc -l 

USB State

Example USB type C port role switch

adb shell dumpsys usb set-port-roles "default" source device

Example USB type C port simulation with full capabilities

adb shell dumpsys usb add-port "matrix" dual
adb shell dumpsys usb connect-port "matrix" ufp? sink? device?
adb shell dumpsys usb ports
adb shell dumpsys usb disconnect-port "matrix"
adb shell dumpsys usb remove-port "matrix"
adb shell dumpsys usb reset

Example USB type C port where only power role can be changed:

adb shell dumpsys usb add-port "matrix" dual
adb shell dumpsys usb connect-port "matrDumpsysix" dfp source? host
adb shell dumpsys usb reset

Example USB OTG port where id pin determines function

adb shell dumpsys usb add-port "matrix" dual
adb shell dumpsys usb connect-port "matrix" dfp source host
adb shell dumpsys usb reset

Example USB device-only port

adb shell dumpsys usb add-port "matrix" ufp
adb shell dumpsys usb connect-port "matrix" ufp sink device
adb shell dumpsys usb reset

Example simulate contaminant status

adb shell dumpsys usb add-port "matrix" ufp
adb shell dumpsys usb set-contaminant-status "matrix" true
adb shell dumpsys usb set-contaminant-status "matrix" false

Example USB device descriptors

adb shell dumpsys usb dump-descriptors -dump-short
adb shell dumpsys usb dump-descriptors -dump-tree
adb shell dumpsys usb dump-descriptors -dump-list
adb shell dumpsys usb dump-descriptors -dump-ra

Scripts

Assign cyan color to each line
adb shell dumpsys -l | awk '{
    printf "\033[36m%s\033[0m\n", $0
}'
Assign random background color to each line
adb shell dumpsys -l | awk 'BEGIN {
    srand()
} {
    color = int(rand() * 230) + 16
    printf "\033[48;5;%dm\033[30m%s\033[0m\n", color, $0
}'
Assign random foreground color to each line
adb shell dumpsys -l | awk 'BEGIN {
    srand()
} {
    color = int(rand() * 7) + 30
    printf "\033[%dm%s\033[0m\n", color, $0
}'
Assign random light foreground color to each line
adb shell dumpsys -l | awk 'BEGIN {
    srand()
} {
    color = int(rand() * 7) + 90
    printf "\033[%dm%s\033[0m\n", color, $0
}'

Comments