Question is straight forward and simple. Is it possible to get the dumpsys information after certain point or certain user action. Not from the scratch.
-
https://stackoverflow.com/questions/27457440/fetching-device-data-through-adb-on-windows?noredirect=1&lq=1 – Nouman Ch Feb 14 '18 at 11:00
-
https://developer.android.com/studio/command-line/dumpsys.html no way define to clear dumpsys info. – Nouman Ch Feb 14 '18 at 11:01
-
1Dont know why down voted. Is it something like dont have answer It will be downvoted :) – Manju Feb 16 '18 at 08:08
2 Answers
There is no such thing.
Logs belong to the logcat
facility. dumpsys
is mostly for reporting the current state and some more advanced things. It is true that few of the Android service developers included some limited logging excerpts into their dumpsys
output but virtually none of them implemented a way to clear those logs.

- 30,437
- 17
- 118
- 169
-
Thanks for your time. Filters are available like activities ,services , broadcasts to trace only info related to it. Do you know something restricted for time like dumpsys after 6000ms with these at least I can filter large amount of info. – Manju Feb 16 '18 at 08:18
I realise this is a bit late but...
As per the documentation:
Connect your mobile device to your computer. Open a terminal and type the following commands to reset the adb server:
adb kill-server
adb devices
This will list any connected devices (If you don't see any devices listed, make sure your phone is connected, and USB Debugging is turned on, and then kill and restart adb again).
Next you will need to reset battery data gathering. The device is always collecting batterystats and other debugging information in the background. Resetting erases old battery collection data. If you do not reset, the output will be huge.
In terminal use command:
adb shell dumpsys batterystats --reset
Disconnect your device from your computer so that you are only drawing current from the device's battery.
Play with your app and perform actions for which you would like data; for example, disconnect from WiFi and send data to the cloud.
Reconnect your phone and make sure it is recognized:
adb devices
Dump all battery data (This can take a while):
adb shell dumpsys batterystats > [path/]batterystats.txt
The batterystats.txt file is created in the directory you specify using the optional path argument. If you leave out [path/], the file is created in your home directory.
You can find the home directory in Android Studio by going to:
Tools > SDK Manager > Android SDK Location.
Navigate to that filepath then open the subdirectory 'platform-tools' and look for batterystats.txt.

- 15
- 4