Battery Historian for Windows environment setup

Source: Internet
Author: User
Tags install go

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

    1. Click to download "Download";
    2. Install go;
    3. 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

    1. Click to download "Download";
    2. Follow the steps to install;
    3. Install complete check: command line input git version

You can also open the Git bash check directly

Third, install Python

    1. Click to download "Download", note only support python2.7
    2. Installation completed;
    3. environment variable configuration, add path, is the path of Python installation
    4. Enter command line PYTHON–V (note is capital V) to check whether the installation was successful

Iv. installation of the Java environment

    1. Click to download "Download";
    2. Complete the installation.

V. Download battery historian source code and run

    1. Enter command line go get-d-u github.com/google/battery-historian/.

      * * Download to the Gopath configuration directory

    2. Enter below the $gopath/src/github.com/google/battery-historian directory
    3. 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>]

    4. 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

    1. Upload Bug Log


    2. View Results

Resources:

Https://github.com/google/battery-historian#wakelock-analysis

Battery Historian for Windows environment setup

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.