android电量测,Android电量测试:battery

介绍了Battery Historian工具,它可通过上传bugreport文件分析手机App电池耗电情况。详细说明了搭建该工具的步骤,包括安装JDK、Python、Go语言,配置环境变量,下载源码等。还阐述了电量测试流程,如运行adb bugreport命令、上传文件等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

66b52468c121889b900d4956032f1009.png

8种机械键盘轴体对比

本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选?

简介:Battery historian是一款通过上传bugreport文件分析用户手机中App的电池耗电情况的工具。

搭建battery-historian安装JDK

安装Python

安装Go语言配置GOROOT和GOPATHGOROOT:Go的安装根目录

GOPATH:Go的工程目录

配置环境变量把Go的bin目录路径加入Path

go version

安装git

下载源码

打开git bash:

[email protected] MINGW64 ~

$ go get -d -u github.com/google/battery-historian/...

找到battery-historian的git目录

[email protected] MINGW64 /e/WorkSpace/GoWorkSpace/src/github.com/google/battery-historian (master)

$ pwd

/e/WorkSpace/GoWorkSpace/src/github.com/google/battery-historian

下载:

[email protected] MINGW64 /e/WorkSpace/GoWorkSpace/src/github.com/google/battery-historian (master)

$ go run setup.go

Downloading Closure library...

Downloading Closure compiler...

Downloading 3rd-party JS files...

Generating JS runfiles...

Generating optimized JS runfiles...

启动: go run cmd/battery-historian/battery-historian.go

[email protected] MINGW64 /e/WorkSpace/GoWorkSpace/src/github.com/google/battery-historian (master)

$ go run cmd/battery-historian/battery-historian.go

2017/02/21 14:00:54 Listening on port: 9999

2017/02/21 14:00:59 Trace starting analysisServer processing for: GET

2017/02/21 14:00:59 Trace finished analysisServer processing for: GET

浏览器打开http:localhost:9999

battery-historian-index.png

电量测试

运行 adb bugreport

连接手机,运行命令:adb bugreport > C:Usersxxxxbugreport.txt

进行操作手机App等,运行一段时间后(看自己的运行场景而定),结束上面的命令(Ctrl + C).

上传bugreport.txt文件

把得到的bugreport.txt上传到battery-historian,结果如下:

battery-historian-bugreport.png

官网文档:https://github.com/google/battery-historian

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值