Battery Historian for Windows environment setup
Summary: Battery Historian is a tool for analyzing the battery consumption of apps in a user's phone by uploading bugreport files.
Battery Historian 1.0 was converted to HTML by a Python script, and the new version Battery Historian 2.0 was released, and the new version brought a lot of improvements: clearer reporting, a summary of each application, faster execution, and more.
Steps
First, install the Go programming language
- Click to download "Download";
- Install go;
- Configuring Goroot and Gopath
A. The role of Goroot is to tell the GO command and other related tools where to find the go package installed on your system, so here is the Go installation directory
B.gopath can be simply understood as a catalog of works, so create a Go project path
C. Finally configure the environment variables, put the Go bin directory in the PATH environment variable
4. Check if go installs successfully, open command line input go version
Second, install Git
- Click to download "Download";
- Follow the steps to install;
- Install complete check: command line input git version
You can also open the Git bash check directly
Third, install Python
- Click to download "Download", note only support python2.7
- Installation completed;
- environment variable configuration, add path, is the path of Python installation
- Enter command line PYTHON–V (note is capital V) to check whether the installation was successful
Iv. installation of the Java environment
- Click to download "Download";
- Complete the installation.
V. Download battery historian source code and run
- Enter command line go get-d-u github.com/google/battery-historian/.
* * Download to the Gopath configuration directory
- Enter below the $gopath/src/github.com/google/battery-historian directory
- Run Battery Historian
A. Go run setup.go
# Compile Javascript files using the Closure compiler
$ go Run setup.go
Wait a few minutes or about 10 minutes, if the download is still not successful, you can manually download the following actions
* * Download "closure-library" and "Closure-compiler" and "Flot-axislabels", unzip and put into Goroot directory Third_ The Closure-compiler and closure-library and Flot-axislabels folders below the Party folder: /battery-historian\third_party, if not all manually created
B. Go run Cmd/battery-historian/battery-historian.go
# Run Historian on your machine (make sure $PATH contains $GOBIN)
$ go Run Cmd/battery-historian/battery-historian.go [--port <default:9999>]
- Check if/battery-historian is running, login URL http://localhost:9999 view
VI. Export the Bugreport log of the phone
1. Input instructions adb bugreport > Bugreport.txt export.
Vii. uploading bugreport.txt files to http://localhost:9999
- Upload Bug Log
- View Results
Resources:
Https://github.com/google/battery-historian#wakelock-analysis
Battery Historian for Windows environment setup