Android Battery Analysis
Preparation-Environment configuration
Note that Python will use the 2.7 series
Download path:
https://www.python.org/
When you're done downloading
Configuring Environment variables
Check if successful
CMD input python
Go Language Environment configuration
Download path:
Https://golang.org/doc/install#testing
Configuring Environment variables
Check if successful
CMD input go version
Configuring the Java Environment
Slightly
Download Battery Historian
Download path:
Https://github.com/google/battery-historian
Operation Steps
1.ADB Kill-server
2.ADB devices view connected devices, guaranteed to be a
3.ADB Shell Dumpsys batterystats--enable full-wake-history
adb shell Dumpsys batterystats--reset
Initialize operation, reset power, prevent interference from other data
4. Unplug the USB cable for a while to play the app
5. Plug in the USB cable input adb bugreport > Bugreport.txt
Will prompt:
`
Bugreport is in progress and it could take minutes to complete.Please be patient and do not cancel or disconnect your device until it completes.
`
A bugreport zip file is then generated
The following procedure is not used
Python historian.py bugreport.txt> bugreport.html
6. Enter the path to the battery historian
Open Bash and enter
Go Run cmd/battery-historian/battery-historian.go
Popup similar to the following information
2018/07/26 20:13:48 Listening on port:9999
2018/07/26 20:13:48 Listen tcp:9999:bind:only One usage of each socket address (protocol/network address/port) is Norma Lly permitted.
Exit Status 1
7. Enter in the browser
http://localhost:9999/
8. Upload the zip file generated in step 5 to generate a power analysis table (this seems to require a ladder)