battery historian

安装 项目主页

方法一 使用dock容器 (推荐该方法)
  1. 下载安装dock 官网
  2. 部署 Battery Historian
docker run -p 9999:9999 gcr.io/android-battery-historian/stable:3.0 --port 9999
  1. 后面再次运行的时候就不需要再部署了,只需要在docker里直接运行即可
❯ docker ps -a
CONTAINER ID        IMAGE                                         COMMAND                  CREATED             STATUS                      PORTS               NAMES
d8ae0c9c924c        gcr.io/android-battery-historian/stable:3.0   "battery-historian..."   3 hours ago         Exited (2) 17 seconds ago                       heuristic_lamarr
❯ docker start d8ae0c9c924c
d8ae0c9c924c
❯ docker stop d8ae0c9c924c
d8ae0c9c924c
❯ docker logs -f d8ae0c9c924c
方法二 使用go、python、git
  1. 下载安装golong
  2. 配置环境变量到/etc/profile文件里
export GOPATH=$HOME/work
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
  1. 拉取项目
go get -d -u github.com/google/battery-historian/...
  1. 拉取成功后运行 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>]

抓取手机信息

  1. To obtain a bug report from your development device running Android 7.0 and higher:
$ adb shell dumpsys batterystats --enable full-wake-history
$ adb shell dumpsys batterystats --reset
$ adb bugreport bugreport.zip
  1. For devices 6.0 and lower:
$ adb bugreport > bugreport.txt

查看分析结果

  1. 打开 http://localhost:9999
  2. 选择上面生成的文件并进行分析
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值