Android uses power analysis--battery historian

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.