What's dumpsys and what are its benefit

dumpsys is an android tool that runs on the device and dumps interesting information about the status of system services.
Obvious benefits:
  1. Possibility to easily get system information in a simple string representation.
  2. Possibility to use dumped CPU, RAM, Battery, storage stats for a pretty charts, which will allow you to check how your application affects the overall device!
What information can we retrieve from dumpsys shell command and how we can use it
If you run dumpsys you would see a ton of system information. But you can use only separate parts of this big dump.

To see all of the "subcommands" of dumpsys do:
$ adb shell dumpsys | grep "DUMP OF SERVICE"

DUMP OF SERVICE ABTPersistenceService:
DUMP OF SERVICE AtCmdFwd:
DUMP OF SERVICE CustomFrequencyManagerService:
DUMP OF SERVICE DirEncryptService:
DUMP OF SERVICE SEAMService:
DUMP OF SERVICE SecExternalDisplayService:
DUMP OF SERVICE SurfaceFlinger:
DUMP OF SERVICE TvoutService_C:
DUMP OF SERVICE accessibility:
DUMP OF SERVICE account:
DUMP OF SERVICE activity:
DUMP OF SERVICE alarm:
DUMP OF SERVICE android.security.keystore:  ... etc




Some Dumping example and output
1) Getting all possible battery statistic:
$~ adb shell dumpsys battery
You will get output:
Current Battery Service state:
AC powered: false
AC capacity: 500000
USB powered: true
status: 5
health: 2
present: truelevel: 100
scale: 100
voltage:4201
temperature: 271 <---------- Battery temperature! %)
technology: Li-poly <---------- Battery technology! %)  
2)Getting IMEI & Device Type informations
~$ adb shell dumpsys iphonesubinfo
Output :

Phone Subscriber Info
  Phone Type = CDMA
  Device ID = 990000249631260

 
dumpsys is ultimately flexible and useful tool!

If you want to use this tool in your application, do not forget to add permission into your android manifest automatically
<uses-permission android:name="android.permission.DUMP" />

Try to test all commands to learn more about dumpsys.  Happy dumping!

No comments:

Post a Comment