Friday 14 June 2019

All about adb shell dumpsys

adb shell dumpsys
What is dumpsys?

This was the word always ticking my head whenever I use to talk to vendors. They always needed this one. So I started reading about it and how it benefited them to resolve the android related issues.
dumpsys : It is nothing but a tool which gives the status of services running on device.

Below is the command which shows the list of all services along with the package name
adb shell service list
Output will be as below

adb shell service list
Fig 1 shell service list

So next question is how to identify the services. So below commands give you list of service
adb shell dumpsys -l
Output will be as below

adb shell dumpsys -l
Fig 2 dumpsys -l
There are many filters which you can use for analyzing the dumpsys data

1. dumpsys activity

It shows the list of activities running at that moment on device
adb shell dumpsys  activity
adb shell dumpsys activity
Fig 3 dumpsys activity


2. dumpsys batterystats

This generates the statistical data for battery usage on device.
adb shell dumpsys batterystats

adb shell dumpsys batterystats
Fig 4 dumpsys batterystats

3. dumpsys cpuinfo

This adb command display the CPU information utilized by device
adb shell dumpsys cpuinfo
adb shell dumpsys cpuinfo
Fig 5 dumpsys cpuinfo

Above output you can see that gaana app have utilized 17% of CPU as it was used last.

4. dumpsys wifi

This command displays the status of wifi
adb shell dumpsys wifi
adb shell dumpsys wifi
Fig 6 dumpsys wifi


5. dumpsys meminfo

This command displays the memory information of the device
adb shell dumpsys meminfo
adb shell dumpsys meminfo
Fig 7 dumpsys meminfo

6. dumpsys procstats

This command displays the process stats
adb shell dumpsys procstats --hours 3
adb shell dumpsys procstats
Fig 8 dumpsys procstats
For more on dumpsys refer to https://developer.android.com/studio/command-line/dumpsys

No comments:

Post a Comment

Feature Posts

Python Appium - Step by step procedure for capturing screenshot

 Why To capture screenshot? It is as important as your logs. If there is any failure for any test scenario, we can provide screenshot for th...