使用 Google Battery Historian

https://github.com/google/battery-historian
只是简单搭建了一下环境,没有具体分析电量消耗原因。

Android adb tool

adb tool, fastboot tool 等都是包含在 SDK Platform-Tools开发包中的。
直接下载这个就可以了。http://www.androiddevtools.cn/

1. Go开发环境搭建

参考链接
1. 下载 go1.7.3.windows-amd64.msi安装
2. 设置 GOPATH环境变量,存放Go语言Package的目录。不能放在go的根目录,新建了c:\godemo
3. 设置 GOBIN环境变量,设置为%GOROOT%\bin

2. 安装 python2.7

3. 安装jdk-8u111-windows-x64.exe

4. 环境搭建完成,运行

下面的命令拷贝自官方readme,替换 $GOPATH 为 %GOPATH%(linux,windows的环境变量符号不一样)。 
`[--port ]`在windows下无法运行,去掉后可以运行。
$ cd $GOPATH/src/github.com/google/battery-historian

# Compile Javascript files using the Closure compiler
$ go run setup.go  #这个命令只需要执行一次

# Run Historian on your machine (make sure $PATH contains $GOBIN)
# Remember, you must always run battery-historian from inside 
# the $GOPATH/src/github.com/google/battery-historian directory
$ go run cmd/battery-historian/battery-historian.go [--port ]

5. 生成bugrepot文件

连接手机,adb bugreport > bugreport.txt得到文件


使用 Google Battery Historian_第1张图片
Paste_Image.png

你可能感兴趣的:(使用 Google Battery Historian)