dumpsys

dumpsys is a tool that runs on Android devices and provides information aboutsystem services. You can call dumpsys from the command line using theAndroid Debug Bridge (ADB)to get diagnostic output for all system services running on a connected device.This output is typically more verbose than you may want, so use the commandline options described below to get output for only the system services you'reinterested in. This page also describes how to use dumpsys to accomplishcommon tasks, such as inspecting input, RAM, battery, or network diagnostics.

Syntax

The general syntax for using dumpsys is as follows:

  1. adb shell dumpsys [-t timeout] [--help | -l | --skip services | service [arguments] | -c | -h]

To get a diagnostic output forall system services for your connected device, simply run adb shell dumpsys.However, this outputs far more information than you would typically want. Formore manageable output, specify the service you want to examine by includingit in the command. For example, the command below provides system data forinput components, such as touchscreens or built-in keyboards:

  1. adb shell dumpsys input

For a complete list of system services that you can use with dumpsys, use thefollowing command:

  1. adb shell dumpsys -l

Command line options

The following table lists the available options when using dumpsys.

Option Description
-t timeout Specifies the timeout period in seconds. When not specified, the default value is 10 seconds.
—help Prints out help text for the dumpsys tool.
-l Outputs a complete list of system services that you can use with dumpsys.
—skip services Specifies the services that you do not want to include in the output.
service [arguments] Specifies the service that you want to output. Some services may allow you to pass optional arguments. You can learn about these optional arguments by passing the -h option with the service, as shown below:

  1. adb shell dumpsys procstats -h


-c When specifying certain services, append this option to output data in a machine-friendly format.
-h For certain services, append this option to see help text and additional options for that service.

Inspect input diagnostics

Specifying the input service, as shown below, dumps the state of thesystem’s input devices, such as keyboards and touchscreens, and theprocessing of input events.

  1. adb shell dumpsys input

The output varies depending on the version of Android running on the connecteddevice. The sections below describe the type of information you typically see.

Event hub state

The following is a sample of what you might see when inspecting theEvent Hub State of the input diagnostics:

  1. INPUT MANAGER (dumpsys input)
  2.  
  3. Event Hub State:
  4. BuiltInKeyboardId: -2
  5. Devices:
  6. -1: Virtual
  7. Classes: 0x40000023
  8. Path:
  9. Descriptor: a718a782d34bc767f4689c232d64d527998ea7fd
  10. Location:
  11. ControllerNumber: 0
  12. UniqueId:
  13. Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
  14. KeyLayoutFile: /system/usr/keylayout/Generic.kl
  15. KeyCharacterMapFile: /system/usr/keychars/Virtual.kcm
  16. ConfigurationFile:
  17. HaveKeyboardLayoutOverlay: false
  18. 1: msm8974-taiko-mtp-snd-card Headset Jack
  19. Classes: 0x00000080
  20. Path: /dev/input/event5
  21. Descriptor: c8e3782483b4837ead6602e20483c46ff801112c
  22. Location: ALSA
  23. ControllerNumber: 0
  24. UniqueId:
  25. Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
  26. KeyLayoutFile:
  27. KeyCharacterMapFile:
  28. ConfigurationFile:
  29. HaveKeyboardLayoutOverlay: false
  30. 2: msm8974-taiko-mtp-snd-card Button Jack
  31. Classes: 0x00000001
  32. Path: /dev/input/event4
  33. Descriptor: 96fe62b244c555351ec576b282232e787fb42bab
  34. Location: ALSA
  35. ControllerNumber: 0
  36. UniqueId:
  37. Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000
  38. KeyLayoutFile: /system/usr/keylayout/msm8974-taiko-mtp-snd-card_Button_Jack.kl
  39. KeyCharacterMapFile: /system/usr/keychars/msm8974-taiko-mtp-snd-card_Button_Jack.kcm
  40. ConfigurationFile:
  41. HaveKeyboardLayoutOverlay: false
  42. 3: hs_detect
  43. Classes: 0x00000081
  44. Path: /dev/input/event3
  45. Descriptor: 485d69228e24f5e46da1598745890b214130dbc4
  46. Location:
  47. ControllerNumber: 0
  48. UniqueId:
  49. Identifier: bus=0x0000, vendor=0x0001, product=0x0001, version=0x0001
  50. KeyLayoutFile: /system/usr/keylayout/hs_detect.kl
  51. KeyCharacterMapFile: /system/usr/keychars/hs_detect.kcm
  52. ConfigurationFile:
  53. HaveKeyboardLayoutOverlay: false
  54. ...

Input reader state

The InputReader is responsible for decoding input events from the kernel. Itsstate dump shows information about how each input device is configured andrecent state changes that have occurred, such as key presses or touches on thetouch screen.

The following sample shows the output for a touch screen. Note the informationabout the resolution of the device and the calibration parameters that wereused.

  1. Input Reader State
  2. ...
  3. Device 6: Melfas MMSxxx Touchscreen
  4. IsExternal: false
  5. Sources: 0x00001002
  6. KeyboardType: 0
  7. Motion Ranges:
  8. X: source=0x00001002, min=0.000, max=719.001, flat=0.000, fuzz=0.999
  9. Y: source=0x00001002, min=0.000, max=1279.001, flat=0.000, fuzz=0.999
  10. PRESSURE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
  11. SIZE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000
  12. TOUCH_MAJOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
  13. TOUCH_MINOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
  14. TOOL_MAJOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
  15. TOOL_MINOR: source=0x00001002, min=0.000, max=1468.605, flat=0.000, fuzz=0.000
  16. Touch Input Mapper:
  17. Parameters:
  18. GestureMode: spots
  19. DeviceType: touchScreen
  20. AssociatedDisplay: id=0, isExternal=false
  21. OrientationAware: true
  22. Raw Touch Axes:
  23. X: min=0, max=720, flat=0, fuzz=0, resolution=0
  24. Y: min=0, max=1280, flat=0, fuzz=0, resolution=0
  25. Pressure: min=0, max=255, flat=0, fuzz=0, resolution=0
  26. TouchMajor: min=0, max=30, flat=0, fuzz=0, resolution=0
  27. TouchMinor: unknown range
  28. ToolMajor: unknown range
  29. ToolMinor: unknown range
  30. Orientation: unknown range
  31. Distance: unknown range
  32. TiltX: unknown range
  33. TiltY: unknown range
  34. TrackingId: min=0, max=65535, flat=0, fuzz=0, resolution=0
  35. Slot: min=0, max=9, flat=0, fuzz=0, resolution=0
  36. Calibration:
  37. touch.size.calibration: diameter
  38. touch.size.scale: 10.000
  39. touch.size.bias: 0.000
  40. touch.size.isSummed: false
  41. touch.pressure.calibration: amplitude
  42. touch.pressure.scale: 0.005
  43. touch.orientation.calibration: none
  44. touch.distance.calibration: none
  45. SurfaceWidth: 720px
  46. SurfaceHeight: 1280px
  47. SurfaceOrientation: 0
  48. Translation and Scaling Factors:
  49. XScale: 0.999
  50. YScale: 0.999
  51. XPrecision: 1.001
  52. YPrecision: 1.001
  53. GeometricScale: 0.999
  54. PressureScale: 0.005
  55. SizeScale: 0.033
  56. OrientationCenter: 0.000
  57. OrientationScale: 0.000
  58. DistanceScale: 0.000
  59. HaveTilt: false
  60. TiltXCenter: 0.000
  61. TiltXScale: 0.000
  62. TiltYCenter: 0.000
  63. TiltYScale: 0.000
  64. Last Button State: 0x00000000
  65. Last Raw Touch: pointerCount=0
  66. Last Cooked Touch: pointerCount=0

At the end of the input reader state dump there is some information about globalconfiguration parameters, such as the tap interval.

  1. Configuration:
  2. ExcludedDeviceNames: []
  3. VirtualKeyQuietTime: 0.0ms
  4. PointerVelocityControlParameters: scale=1.000, lowThreshold=500.000, highThreshold=3000.000, acceleration=3.000
  5. WheelVelocityControlParameters: scale=1.000, lowThreshold=15.000, highThreshold=50.000, acceleration=4.000
  6. PointerGesture:
  7. Enabled: true
  8. QuietInterval: 100.0ms
  9. DragMinSwitchSpeed: 50.0px/s
  10. TapInterval: 150.0ms
  11. TapDragInterval: 300.0ms
  12. TapSlop: 20.0px
  13. MultitouchSettleInterval: 100.0ms
  14. MultitouchMinDistance: 15.0px
  15. SwipeTransitionAngleCosine: 0.3
  16. SwipeMaxWidthRatio: 0.2
  17. MovementSpeedRatio: 0.8
  18. ZoomSpeedRatio: 0.3

Input dispatcher state

The InputDispatcher is responsible for sending input events to applications.As shown in the sample output below, its state dump shows information aboutwhich window is being touched, the state of the input queue, whether an ANR isin progress, and so on.

  1. Input Dispatcher State:
  2. DispatchEnabled: 1
  3. DispatchFrozen: 0
  4. FocusedApplication: <null>
  5. FocusedWindow: name='Window{3fb06dc3 u0 StatusBar}'
  6. TouchStates: <no displays touched>
  7. Windows:
  8. 0: name='Window{357bbbfe u0 SearchPanel}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01820100, type=0x000007e8, layer=211000, frame=[0,0][1080,1920], scale=1.000000, touchableRegion=[0,0][1080,1920], inputFeatures=0x00000000, ownerPid=22674, ownerUid=10020, dispatchingTimeout=5000.000ms
  9. 1: name='Window{3b14c0ca u0 NavigationBar}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=false, canReceiveKeys=false, flags=0x01840068, type=0x000007e3, layer=201000, frame=[0,1776][1080,1920], scale=1.000000, touchableRegion=[0,1776][1080,1920], inputFeatures=0x00000000, ownerPid=22674, ownerUid=10020, dispatchingTimeout=5000.000ms
  10. 2: name='Window{2c7e849c u0 com.vito.lux}', displayId=0, paused=false, hasFocus=false, hasWallpaper=false, visible=true, canReceiveKeys=false, flags=0x0089031a, type=0x000007d6, layer=191000, frame=[-495,-147][1575,1923], scale=1.000000, touchableRegion=[-495,-147][1575,1923], inputFeatures=0x00000000, ownerPid=4697, ownerUid=10084, dispatchingTimeout=5000.000ms
  11. ...
  12. MonitoringChannels:
  13. 0: 'WindowManager (server)'
  14. RecentQueue: length=10
  15. MotionEvent(deviceId=4, source=0x00001002, action=2, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (335.0, 1465.0)]), policyFlags=0x62000000, age=217264.0ms
  16. MotionEvent(deviceId=4, source=0x00001002, action=1, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (335.0, 1465.0)]), policyFlags=0x62000000, age=217255.7ms
  17. MotionEvent(deviceId=4, source=0x00001002, action=0, flags=0x00000000, metaState=0x00000000, buttonState=0x00000000, edgeFlags=0x00000000, xPrecision=1.0, yPrecision=1.0, displayId=0, pointers=[0: (330.0, 1283.0)]), policyFlags=0x62000000, age=216805.0ms
  18. ...
  19. PendingEvent: <none>
  20. InboundQueue: <empty>
  21. ReplacedKeys: <empty>
  22. Connections:
  23. 0: channelName='WindowManager (server)', windowName='monitor', status=NORMAL, monitor=true, inputPublisherBlocked=false
  24. OutboundQueue: <empty>
  25. WaitQueue: <empty>
  26. 1: channelName='278c1d65 KeyguardScrim (server)', windowName='Window{278c1d65 u0 KeyguardScrim}', status=NORMAL, monitor=false, inputPublisherBlocked=false
  27. OutboundQueue: <empty>
  28. WaitQueue: <empty>
  29. 2: channelName='357bbbfe SearchPanel (server)', windowName='Window{357bbbfe u0 SearchPanel}', status=NORMAL, monitor=false, inputPublisherBlocked=false
  30. OutboundQueue: <empty>
  31. WaitQueue: <empty>
  32. ...
  33. AppSwitch: not pending
  34. 7: channelName='2280455f com.google.android.gm/com.google.android.gm.ConversationListActivityGmail (server)', windowName='Window{2280455f u0 com.google.android.gm/com.google.android.gm.ConversationListActivityGmail}', status=NORMAL, monitor=false, inputPublisherBlocked=false
  35. OutboundQueue: <empty>
  36. WaitQueue: <empty>
  37. 8: channelName='1a7be08a com.android.systemui/com.android.systemui.recents.RecentsActivity (server)', windowName='Window{1a7be08a u0 com.android.systemui/com.android.systemui.recents.RecentsActivity EXITING}', status=NORMAL, monitor=false, inputPublisherBlocked=false
  38. OutboundQueue: <empty>
  39. WaitQueue: <empty>
  40. 9: channelName='3b14c0ca NavigationBar (server)', windowName='Window{3b14c0ca u0 NavigationBar}', status=NORMAL, monitor=false, inputPublisherBlocked=false
  41. OutboundQueue: <empty>
  42. WaitQueue: <empty>
  43. ...
  44. Configuration:
  45. KeyRepeatDelay: 50.0ms
  46. KeyRepeatTimeout: 500.0ms

Things to check for

The following is a list of things to consider when inspecting the various outputfor the input service:

Event hub state:

  • All of the input devices you expect are present.
  • Each input device has an appropriate key layout file, key character map file, and input device configuration file. If the files are missing or contain syntax errors, then they will not be loaded.
  • Each input device is classified correctly. The bits in the Classes field correspond to flags in EventHub.h, such as INPUT_DEVICE_CLASS_TOUCH_MT.
  • The BuiltInKeyboardId is correct. If the device does not have a built-in keyboard, then the id must be -2. Otherwise, it should be the id of the built-in keyboard.
  • If you observe that the BuiltInKeyboardId is not -2 but it should be, then you are missing a key character map file for a special function keypad somewhere. Special function keypad devices should have key character map files that contain just the line type
    1. SPECIAL_FUNCTION</code> (that&#39;s what in the <code>tuna-gpio-keykad.kcm</code> file we see mentioned above).

Input reader state:

  • All of the expected input devices are present.
  • Each input device is configured correctly. In particular, check that thetouch screen and joystick axes are correct.
    Input dispatcher state:

  • All input events are processed as expected.

  • After touching the touch screen and running dumpsys at the same time, theTouchStates line correctly identifies the window that you are touching.

Test UI performance

Specifying the gfxinfo service provides output with performance informationrelating to frames of animation that are occurring during the recording phase.The following command uses gfxinfo to gather UI performance data for aspecified package name:

  1. adb shell dumpsys gfxinfo package-name

You can also include the framestats option to provide even more detailed frametiming information from recent frames, so that you can track down and debugproblems more accurately, shown below:

  1. adb shell dumpsys gfxinfo package-name framestats

To learn more about using gfxinfo and framestats to integrate UIperformance measurements into your testing practices, go toTesting UI performance.

Inspect network diagnostics

Specifying the netstats service provides network usage statistics collected sincethe previous device booted up. To output additional information, such asdetailed unique user ID (UID) information, include the detail option, asfollows:

  1. adb shell dumpsys netstats detail

The output varies depending on the version of Android running on the connecteddevice. The sections below describe the type of information you typically see.

Active interfaces and active UID interfaces

The following sample output lists the active interfaces and active UIDinterfaces of the connected device. In most cases, the information for activeinterfaces and active UID interfaces is the same.

  1. Active interfaces:
  2. iface=wlan0 ident=[{type=WIFI, subType=COMBINED, networkId="Guest"}]
  3. Active UID interfaces:
  4. iface=wlan0 ident=[{type=WIFI, subType=COMBINED, networkId="Guest"}]

'Dev' and 'Xt' statistics

The following is a sample output for the Dev statistics section:

  1. Dev stats:
  2. Pending bytes: 1798112
  3. History since boot:
  4. ident=[{type=WIFI, subType=COMBINED, networkId="Guest", metered=false}] uid=-1 set=ALL tag=0x0
  5. NetworkStatsHistory: bucketDuration=3600
  6. st=1497891600 rb=1220280 rp=1573 tb=309870 tp=1271 op=0
  7. st=1497895200 rb=29733 rp=145 tb=85354 tp=185 op=0
  8. st=1497898800 rb=46784 rp=162 tb=42531 tp=192 op=0
  9. st=1497902400 rb=27570 rp=111 tb=35990 tp=121 op=0
  10. Xt stats:
  11. Pending bytes: 1771782
  12. History since boot:
  13. ident=[{type=WIFI, subType=COMBINED, networkId="Guest", metered=false}] uid=-1 set=ALL tag=0x0
  14. NetworkStatsHistory: bucketDuration=3600
  15. st=1497891600 rb=1219598 rp=1557 tb=291628 tp=1255 op=0
  16. st=1497895200 rb=29623 rp=142 tb=82699 tp=182 op=0
  17. st=1497898800 rb=46684 rp=160 tb=39756 tp=191 op=0
  18. st=1497902400 rb=27528 rp=110 tb=34266 tp=120 op=0

UID stats

The following is a sample of detailed statistics of each UID.

  1. UID stats:
  2. Pending bytes: 744
  3. Complete history:
  4. ident=[[type=MOBILE_SUPL, subType=COMBINED, subscriberId=311111...], [type=MOBILE, subType=COMBINED, subscriberId=311111...]] uid=10007 set=DEFAULT tag=0x0
  5. NetworkStatsHistory: bucketDuration=7200000
  6. bucketStart=1406167200000 activeTime=7200000 rxBytes=4666 rxPackets=7 txBytes=1597 txPackets=10 operations=0
  7. ident=[[type=WIFI, subType=COMBINED, networkId="MySSID"]] uid=10007 set=DEFAULT tag=0x0
  8. NetworkStatsHistory: bucketDuration=7200000
  9. bucketStart=1406138400000 activeTime=7200000 rxBytes=17086802 rxPackets=15387 txBytes=1214969 txPackets=8036 operations=28
  10. bucketStart=1406145600000 activeTime=7200000 rxBytes=2396424 rxPackets=2946 txBytes=464372 txPackets=2609 operations=70
  11. bucketStart=1406152800000 activeTime=7200000 rxBytes=200907 rxPackets=606 txBytes=187418 txPackets=739 operations=0
  12. bucketStart=1406160000000 activeTime=7200000 rxBytes=826017 rxPackets=1126 txBytes=267342 txPackets=1175 operations=35

To find the UID for your app, run this command: adb shell dumpsys
package your-package-name
. Then look for the line labeleduserId.

For example, to find network usage for the app 'com.example.myapp', run thefollowing command:

  1. adb shell dumpsys package com.example.myapp | grep userId

the output should be similar to the following:

  1. userId=10007 gids=[3003, 1028, 1015]

Using the sample dump above, look for lines that have uid=10007. Two suchlines exist—the first indicates a mobile connection and the second indicates aWi-Fi connection. Below each line, you can see the following information foreach two-hour window (which bucketDuration specifies in milliseconds):

  • set=DEFAULT indicates foreground network usage, while set=BACKGROUND indicatesbackground usage. set=ALL implies both.
  • tag=0x0 indicates the socket tag associated with the traffic.
  • rxBytes and rxPackets represent received bytes and received packets in the corresponding time interval.
  • txBytes and txPackets represent sent (transmitted) bytes and sent packets in the corresponding time interval.

Inspect battery diagnostics

Specifying the batterystats service generates interesting statistical dataabout battery usage on a device, organized by unique user ID (UID). To learn howto use dumpsys to test your app for Doze and App Standby, go toTesting with Doze and App Standby.

The command for batterystats is as follows:

  1. adb shell dumpsys batterystats options

To see a list of additional options available to batterystats, include the-h option. The example below outputs battery usage statistics for aspecified app package since the device was last charged:

  1. adb shell dumpsys batterystats --charged package-name

The output typically includes the following:

  • History of battery-related events
  • Global statistics for the device
  • Approximate power use per UID and system component
  • Per-app mobile milliseconds per packet
  • System UID aggregated statistics
  • App UID aggregated statistics
    To learn more about using batterystats and generating an HTML visualization ofthe output, which makes it easier to understand and diagnose battery-relatedissues, read Profile battery usage with Batterystats and Battery Historian.

Inspecting machine-friendly output

You can generate batterystats output in machine-readable CSV format by usingthe following command:

  1. adb shell dumpsys batterystats --checkin

The following is an example of the output you should see:

  1. 9,0,i,vers,11,116,K,L
  2. 9,0,i,uid,1000,android
  3. 9,0,i,uid,1000,com.android.providers.settings
  4. 9,0,i,uid,1000,com.android.inputdevices
  5. 9,0,i,uid,1000,com.android.server.telecom
  6. ...
  7. 9,0,i,dsd,1820451,97,s-,p-
  8. 9,0,i,dsd,3517481,98,s-,p-
  9. 9,0,l,bt,0,8548446,1000983,8566645,1019182,1418672206045,8541652,994188
  10. 9,0,l,gn,0,0,666932,495312,0,0,2104,1444
  11. 9,0,l,m,6794,0,8548446,8548446,0,0,0,666932,495312,0,697728,0,0,0,5797,0,0
  12. ...

Battery-usage observations may be per-UID or system-level; data is selected forinclusion based on its usefulness in analyzing battery performance. Each rowrepresents an observation with the following elements:

  • A dummy integer
  • The user ID associated with the observation
  • The aggregation mode:
    • "i" for information not tied to charged/uncharged status.
    • "l" for —charged (usage since last charge).
    • "u" for —unplugged (usage since last unplugged). Deprecated in Android 5.1.1.
  • Section identifier, whichdetermines how to interpret subsequent values in the line.
    The table below describes the various section identifiers you may see:
Section identifierDescriptionRemaining fields

vers

Version

checkin version, parcel version, start platform version, end platform version

uid

UID

uid, package name

apk

APK

wakeups, APK, service, start time, starts, launches

pr

Process

process, user, system, foreground, starts

sr

Sensor

sensor number, time, count

vib

Vibrator

time, count

fg

Foreground

time, count

st

State Time

foreground, active, running

wl

Wake lock

wake lock, full time, 'f', full count, partial time, 'p', partial count, window time, 'w', window count

sy

Sync

sync, time, count

jb

Job

job, time, count

kwl

Kernel Wake Lock

kernel wake lock, time, count

wr

Wakeup Reason

wakeup reason, time, count

nt

Network

mobile bytes RX, mobile bytes TX, Wi-Fi bytes RX, Wi-Fi bytes TX, mobile packets RX, mobile packets TX, Wi-Fi packets RX, Wi-Fi packets TX, mobile active time, mobile active count

ua

User Activity

other, button, touch

bt

Battery

start count, battery realtime, battery uptime, total realtime, total uptime, start clock time, battery screen off realtime, battery screen off uptime

dc

Battery Discharge

low, high, screen on, screen off

lv

Battery Level

start level, current level

wfl

Wi-Fi

full Wi-Fi lock on time, Wi-Fi scan time, Wi-Fi running time, Wi-Fi scan count, Wi-Fi idle time, Wi-Fi receive time, Wi-Fi transmit time

gwfl

Global Wi-Fi

Wi-Fi on time, Wi-Fi running time, Wi-Fi idle time, Wi-Fi receive time, Wi-Fi transmit time, Wi-Fi power (mAh)

gble

Global Bluetooth

BT idle time, BT receive time, BT transmit time, BT power (mAh)

m

Misc

screen on time, phone on time, full wakelock time total, partial wakelock time total, mobile radio active time, mobile radio active adjusted time, interactive time, power save mode enabled time, connectivity changes, device idle mode enabled time, device idle mode enabled count, device idling time, device idling count, mobile radio active count, mobile radio active unknown time

gn

Global Network

mobile RX total bytes, mobile TX total bytes, Wi-Fi RX total bytes, Wi-Fi TX total bytes, mobile RX total packets, mobile TX total packets, Wi-Fi RX total packets, Wi-Fi TX total packets

br

Screen Brightness

dark, dim, medium, light, bright

sst

Signal Scanning Time

signal scanning time

sgt

Signal Strength Time

none, poor, moderate, good, great

sgc

Signal Strength Count

none, poor, moderate, good, great

dct

Data Connection Time

none, GPRS, EDGE, UMTS, CDMA, EVDO_0, EVDO_A, 1xRTT, HSDPA, HSUPA, HSPA, IDEN, EVDO_B, LTE, EHRPD, HSPAP, other

dcc

Data Connection Count

none, GPRS, EDGE, UMTS, CDMA, EVDO_0, EVDO_A, 1xRTT, HSDPA, HSUPA, HSPA, IDEN, EVDO_B, LTE, EHRPD, HSPAP, other

wst

Wi-Fi State Time

off, off scanning, on no networks, on disconnected, on connected STA, on connected P2P, on connected STA P2P, soft AP

wsc

Wi-Fi State Count

off, off scanning, on no networks, on disconnected, on connected STA, on connected P2P, on connected STA P2P, soft AP

wsst

Wi-Fi Supplicant State Time

invalid, disconnected, interface disabled, inactive, scanning, authenticating, associating, associated, four-way handshake, group handshake, completed, dormant, uninitialized

wssc

Wi-Fi Supplicant State Count

invalid, disconnected, interface disabled, inactive, scanning, authenticating, associating, associated, four-way handshake, group handshake, completed, dormant, uninitialized

wsgt

Wi-Fi Signal Strength Time

none, poor, moderate, good, great

wsgc

Wi-Fi Signal Strength Count

none, poor, moderate, good, great

bst

Bluetooth State Time

inactive, low, med, high

bsc

Bluetooth State Count

inactive, low, med, high

pws

Power Use Summary

battery capacity, computed power, minimum drained power, maximum drained power

pwi

Power Use Item

label, mAh

dsd

Discharge Step

duration, level, screen, power-save

csd

Charge Step

duration, level, screen, power-save

dtr

Discharge Time Remaining

battery time remaining

ctr

Charge Time Remaining

charge time remaining

Note: Prior to Android 6.0, power use forBluetooth radio, cellular radio, and Wi-Fi was tracked in the m (Misc)section category. In Android 6.0 and higher, power use for these components istracked in the pwi (Power Use Item) section with individual labels(wifi, blue, cell) for each component.

View memory allocations

You can inspect your app's memory usage in one of two ways: over a period oftime using procstats or at a particular snapshot in time using meminfo.The sections below show you how to use either method.

procstats

procstats makes it possible to see how your app is behaving over time—includinghow long it runs in the background and how much memory it uses during that time.It helps you quickly find inefficiencies and misbehaviors in your app, such asmemory leaks, that can affect how it performs, especially when running onlow-memory devices. Its state dump displays statistics about everyapplication’s runtime, proportional set size (PSS) and unique set size (USS).

To get application memory usage stats over the last three hours, inhuman-readable format, run the following command:

  1. adb shell dumpsys procstats --hours 3

As can be seen in the example below, the output displays what percentageof time the application was running, and the PSS and USS asminPSS-avgPSS-maxPSS/minUSS-avgUSS-maxUSS over the number of samples.

  1. AGGREGATED OVER LAST 3 HOURS:
  2. * com.android.systemui / u0a20 / v22:
  3. TOTAL: 100% (109MB-126MB-159MB/108MB-125MB-157MB over 18)
  4. Persistent: 100% (109MB-126MB-159MB/108MB-125MB-157MB over 18)
  5. * com.android.nfc / 1027 / v22:
  6. TOTAL: 100% (17MB-17MB-17MB/16MB-16MB-16MB over 18)
  7. Persistent: 100% (17MB-17MB-17MB/16MB-16MB-16MB over 18)
  8. * android.process.acore / u0a4 / v22:
  9. TOTAL: 100% (14MB-15MB-15MB/14MB-14MB-14MB over 20)
  10. Imp Fg: 100% (14MB-15MB-15MB/14MB-14MB-14MB over 20)
  11. ...
  12. * com.coulombtech / u0a106 / v26:
  13. TOTAL: 0.01%
  14. Receiver: 0.01%
  15. (Cached): 21% (4.9MB-5.0MB-5.2MB/3.8MB-3.9MB-4.1MB over 2)
  16. * com.softcoil.mms / u0a86 / v32:
  17. TOTAL: 0.01%
  18. (Cached): 0.25%
  19. * com.udemy.android / u0a91 / v38:
  20. TOTAL: 0.01%
  21. Receiver: 0.01%
  22. (Cached): 0.75% (9.8MB-9.8MB-9.8MB/8.5MB-8.5MB-8.5MB over 1)
  23. ...
  24. Run time Stats:
  25. SOff/Norm: +32m52s226ms
  26. SOn /Norm: +2h10m8s364ms
  27. Mod : +17s930ms
  28. TOTAL: +2h43m18s520ms
  29.  
  30. Memory usage:
  31. Kernel : 265MB (38 samples)
  32. Native : 73MB (38 samples)
  33. Persist: 262MB (90 samples)
  34. Top : 190MB (325 samples)
  35. ImpFg : 204MB (569 samples)
  36. ImpBg : 754KB (345 samples)
  37. Service: 93MB (1912 samples)
  38. Receivr: 227KB (1169 samples)
  39. Home : 66MB (12 samples)
  40. LastAct: 30MB (255 samples)
  41. CchAct : 220MB (450 samples)
  42. CchCAct: 193MB (71 samples)
  43. CchEmty: 182MB (652 samples)
  44. Cached : 58MB (38 samples)
  45. Free : 60MB (38 samples)
  46. TOTAL : 1.9GB
  47. ServRst: 50KB (278 samples)
  48.  
  49. Start time: 2015-04-08 13:44:18
  50. Total elapsed time: +2h43m18s521ms (partial) libart.so

meminfo

You can record a snapshot of how your app's memory isdivided between different types of RAM allocation with thefollowing command:

  1. adb shell dumpsys meminfo package_name|pid [-d]

The -d flag prints more info related to Dalvik and ART memory usage.

The output lists all of your app's current allocations, measured in kilobytes.

When inspecting this information, you should be familiar with thefollowing types of allocation:

  • Private (Clean and Dirty) RAM
  • This is memory that is being used by only your process. This is the bulk of the RAM that thesystem can reclaim when your app’s process is destroyed. Generally, the most important portion of this is private dirty RAM, which is the most expensive because it is used by only yourprocess and its contents exist only in RAM so can’t be paged to storage (because Android does notuse swap). All Dalvik and native heap allocations you make will be private dirty RAM; Dalvik andnative allocations you share with the Zygote process are shared dirty RAM.
  • Proportional Set Size (PSS)
  • This is a measurement of your app’s RAM use that takes into account sharing pages acrossprocesses. Any RAM pages that are unique to your process directly contribute to its PSS value,while pages that are shared with other processes contribute to the PSS value only in proportion tothe amount of sharing. For example, a page that is shared between two processes will contributehalf of its size to the PSS of each process.
    A nice characteristic of the PSS measurement is that you can add up the PSS across all processesto determine the actual memory being used by all processes. This means PSS is a good measure for theactual RAM weight of a process and for comparison against the RAM use of other processes and thetotal available RAM.

For example, below is the output for Map’s process on a Nexus 5 device. There is a lot ofinformation here, but key points for discussion are listed below.

adb shell dumpsys meminfo com.google.android.apps.maps -d

Note: The information you see might vary slightly from what is shownhere, because some details of the output differ across platform versions.

  1. ** MEMINFO in pid 18227 [com.google.android.apps.maps] **
  2. Pss Private Private Swapped Heap Heap Heap
  3. Total Dirty Clean Dirty Size Alloc Free
  4. ------ ------ ------ ------ ------ ------ ------
  5. Native Heap 10468 10408 0 0 20480 14462 6017
  6. Dalvik Heap 34340 33816 0 0 62436 53883 8553
  7. Dalvik Other 972 972 0 0
  8. Stack 1144 1144 0 0
  9. Gfx dev 35300 35300 0 0
  10. Other dev 5 0 4 0
  11. .so mmap 1943 504 188 0
  12. .apk mmap 598 0 136 0
  13. .ttf mmap 134 0 68 0
  14. .dex mmap 3908 0 3904 0
  15. .oat mmap 1344 0 56 0
  16. .art mmap 2037 1784 28 0
  17. Other mmap 30 4 0 0
  18. EGL mtrack 73072 73072 0 0
  19. GL mtrack 51044 51044 0 0
  20. Unknown 185 184 0 0
  21. TOTAL 216524 208232 4384 0 82916 68345 14570
  22.  
  23. Dalvik Details
  24. .Heap 6568 6568 0 0
  25. .LOS 24771 24404 0 0
  26. .GC 500 500 0 0
  27. .JITCache 428 428 0 0
  28. .Zygote 1093 936 0 0
  29. .NonMoving 1908 1908 0 0
  30. .IndirectRef 44 44 0 0
  31.  
  32. Objects
  33. Views: 90 ViewRootImpl: 1
  34. AppContexts: 4 Activities: 1
  35. Assets: 2 AssetManagers: 2
  36. Local Binders: 21 Proxy Binders: 28
  37. Parcel memory: 18 Parcel count: 74
  38. Death Recipients: 2 OpenSSL Sockets: 2

Here is an older dumpsys on Dalvik of the gmail app:

  1. ** MEMINFO in pid 9953 [com.google.android.gm] **
  2. Pss Pss Shared Private Shared Private Heap Heap Heap
  3. Total Clean Dirty Dirty Clean Clean Size Alloc Free
  4. ------ ------ ------ ------ ------ ------ ------ ------ ------
  5. Native Heap 0 0 0 0 0 0 7800 7637(6) 126
  6. Dalvik Heap 5110(3) 0 4136 4988(3) 0 0 9168 8958(6) 210
  7. Dalvik Other 2850 0 2684 2772 0 0
  8. Stack 36 0 8 36 0 0
  9. Cursor 136 0 0 136 0 0
  10. Ashmem 12 0 28 0 0 0
  11. Other dev 380 0 24 376 0 4
  12. .so mmap 5443(5) 1996 2584 2664(5) 5788 1996(5)
  13. .apk mmap 235 32 0 0 1252 32
  14. .ttf mmap 36 12 0 0 88 12
  15. .dex mmap 3019(5) 2148 0 0 8936 2148(5)
  16. Other mmap 107 0 8 8 324 68
  17. Unknown 6994(4) 0 252 6992(4) 0 0
  18. TOTAL 24358(1) 4188 9724 17972(2)16388 4260(2)16968 16595 336
  19.  
  20. Objects
  21. Views: 426 ViewRootImpl: 3(8)
  22. AppContexts: 6(7) Activities: 2(7)
  23. Assets: 2 AssetManagers: 2
  24. Local Binders: 64 Proxy Binders: 34
  25. Death Recipients: 0
  26. OpenSSL Sockets: 1
  27.  
  28. SQL
  29. MEMORY_USED: 1739
  30. PAGECACHE_OVERFLOW: 1164 MALLOC_SIZE: 62

In general, be concerned with only the Pss Total and Private Dirtycolumns. In some cases, the Private Clean and Heap Alloc columns alsooffer interesting data. More information about the different memory allocations (the rows) youshould observe follows:

  • Dalvik Heap
  • The RAM used by Dalvik allocations in your app. The Pss Total includes all Zygoteallocations (weighted by their sharing across processes, as described in the PSS definition above).The Private Dirty number is the actual RAM committed to only your app’s heap, composedof your own allocations and any Zygote allocation pages that have been modified since forking yourapp’s process from Zygote.
    Note: On newer platform versions that have the Dalvik
    Other
    section, the Pss Total and Private Dirty numbers for DalvikHeap do not include Dalvik overhead such as the just-in-time compilation (JIT) and GCbookkeeping, whereas older versions list it all combined under Dalvik.

The Heap Alloc is the amount of memory that the Dalvik and native heap allocatorskeep track of for your app. This value is larger than Pss Total and Private
Dirty
because your process was forked from Zygote and it includes allocations that yourprocess shares with all the others.

  • .so mmap and .dex mmap
  • The RAM being used for mapped .so (native) and .dex (Dalvik or ART)code. The Pss Total number includes platform code shared across apps; thePrivate Clean is your app’s own code. Generally, the actual mapped size will be muchlarger—the RAM here is only what currently needs to be in RAM for code that has been executed bythe app. However, the .so mmap has a large private dirty, which is due to fix-ups to the nativecode when it was loaded into its final address.
  • .oat mmap
  • This is the amount of RAM used by the code image which is based off of the preloaded classeswhich are commonly used by multiple apps. This image is shared across all apps and is unaffectedby particular apps.
  • .art mmap
  • This is the amount of RAM used by the heap image which is based off of the preloaded classeswhich are commonly used by multiple apps. This image is shared across all apps and is unaffectedby particular apps. Even though the ART image containsObject instances, it does not counttowards your heap size.
  • .Heap (only with -d flag)
  • This is the amount of heap memory for your app. This excludes objects in the image and largeobject spaces, but includes the zygote space and non-moving space.
  • .LOS (only with -d flag)
  • This is the amount of RAM used by the ART large object space. This includes zygote largeobjects. Large objects are all primitive array allocations larger than 12KB.
  • .GC (only with -d flag)
  • This is the overhead cost for garbage collection. There is not really anyway to reduce this overhead.
  • .JITCache (only with -d flag)
  • This is the amount of memory used by the JIT data and code caches. Typically, this is zerosince all of the apps will be compiled at installed time.
  • .Zygote (only with -d flag)
  • This is the amount of memory used by the zygote space. The zygote space is created duringdevice startup and is never allocated into.
  • .NonMoving (only with -d flag)
  • This is the amount of RAM used by the ART non-moving space. The non-moving space containsspecial non-movable objects such as fields and methods. You can reduce this section by using fewerfields and methods in your app.
  • .IndirectRef (only with -d flag)
  • This is the amount of RAM used by the ART indirect reference tables. Usually this amount issmall, but if it is too high, it might be possible to reduce it by reducing the number of local andglobal JNI references used.
  • Unknown
  • Any RAM pages that the system could not classify into one of the other more specific items.Currently, this contains mostly native allocations, which cannot be identified by the tool whencollecting this data due to Address Space Layout Randomization (ASLR). Like the Dalvik heap, thePss Total for Unknown takes into account sharing with Zygote, and Private
    Dirty
    is unknown RAM dedicated to only your app.
  • TOTAL
  • The total Proportional Set Size (PSS) RAM used by your process. This is the sum of all PSS fieldsabove it. It indicates the overall memory weight of your process, which can be directly comparedwith other processes and the total available RAM.
    The Private Dirty and Private Clean are the total allocations withinyour process, which are not shared with other processes. Together (especiallyPrivate Dirty), this is the amount of RAM that will be released back to the system whenyour process is destroyed. Dirty RAM is pages that have been modified and so must stay committed toRAM (because there is no swap); clean RAM is pages that have been mapped from a persistent file(such as code being executed) and so can be paged out if not used for a while.
  • ViewRootImpl
  • The number of root views that are active in your process. Each root view is associated with awindow, so this can help you identify memory leaks involving dialogs or other windows.
  • AppContexts and Activities
  • The number of app Contextand Activity objects thatcurrently live in your process. This can help you to quickly identify leakedActivity objects that can’t begarbage collected due to static references on them, which is common. These objects often have manyother allocations associated with them, which makes them a good way to track large memory leaks.

Note: A Viewor Drawable objectalso holds a reference to the Activitythat it's from, so holding a View orDrawable object canalso lead to your app leaking anActivity.