battery historian 官网,里面有英文版的详细文档。
为什么要安装battery historian,是因为我们在adb bugreport 会得到一个庞大的文件,大概有12M以上。而battery historian就是帮助我们分析这个文件的工具。
我采用的是build from source code 模式,下面做下归纳。
1. 安装go
2. 安装git
3. 在git-bash里面执行下面命令
$ go get -d -u github.com/google/battery-historian/...
Finally, run Battery Historian!
$ 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)
$ go run cmd/battery-historian/battery-historian.go [--port <default:9999>]
下图是我执行的截图
4.在浏览器中运行http://localhost:9999,下面是我的截图
5.在cmd中执行adb report > report.txt,我碰到了一个坑,见下图
如果你遇到上面这个坑,那是因为android sdk升级的问题,所以你需要下载一个低版本的platform-tools,接下来你就会得到一个report.txt 文件,
6.你需要在http://localhost:9999中choose a bugreport file,把report.txt 上传。
安装过程到这里就结束了,下期会写下使用battery historian的体验。