A new tool has come that comes with Android 5.0.
You can run
adb shell dumpsys batterystats > dump.txt
To get the full backup battery of your device. You can also add some parameters, such as --unplugged (only output from the last disconnect) or --charged (only output from the last charge). You can also add a package name to receive information only for this package / application:
adb shell dumpsys batterystats --unplugged your.package.name > dump.txt
The > dump.txt puts everything in a file (maybe it just works on Windows, but not sure. But you can just leave it, the dump will be printed right on the console, where you can copy it and put it in a file).
This only works if you have a device with Android 5.x. If you have a device with a lower level, you can try to use
adb shell bugreport > bugreport.txt
But this file will be very large. (~ 8MB +)
After creating this file, you can use the Historian Tool for Google
To use it, you must install Python 2.7.9 and run the following command
python /path/to/historian.py dump.txt > battery.html
This will create a battery.html file where you can see the data in a more convenient format.
Last thing: If you want to reset, battery dump statistics just calls
adb shell dumpsys batterystats --reset
(just works with Android 5.x)
Informatic0re Jan 07 '15 at 14:15 2015-01-07 14:15
source share