Battery Historian配置

battery-historian github:

GitHub - google/battery-historian: Battery Historian is a tool to analyze battery consumers using Android "bugreport" files.

安卓官网:
https://developer.android.google.cn/topic/performance/power/setup-battery-historian?hl=zh_cn
docker官网:
https://docs.docker.com/engine/install/
进去选择ubuntu安装:
https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository
提供了3种安装方式:
1、repository安装
2、安装包安装
3、脚本安装
第一种方式试了没成功,使用第二种方式
第二种方式安装:
要选择ubuntu版本,看ubuntu版本代号的命令:
https://www.bnskd.com/9758.html
lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:    18.04
Codename:    bionic
Codename就是代号
进入相应的代号目录下

或者直接运行
docker run hello-world

Command 'docker' not found, but can be installed with:

sudo snap install docker     # version 20.10.12, or
sudo apt  install docker.io

See 'snap info docker' for additional versions.
按提示安装

然后按安卓官网执行:
sudo docker run -p 666:9999 gcr.io/android-battery-historian/stable:3.0 --port 9999

Unable to find image 'gcr.io/android-battery-historian/stable:3.0' locally
docker: Error response from daemon: Get https://gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.
有错误提示
找到原因:
https://blog.csdn.net/scau_zhangpeng/article/details/80919277
使用阿里云的镜像,命令:
sudo docker run -p 9000:9999 registry.cn-hangzhou.aliyuncs.com/xyz10/android-battery-historian:stable-3.0

启动成功,然后在浏览器输入:
http://localhost:9000/
localhost换成自己本机ip地址。

windows配置battery-historian方法
https://blog.csdn.net/zeqiao/article/details/77504477

或者直接访问:
https://bathist.ef.lc/

Battery Historian是一个用于分析Android设备电池使用情况的工具,下面是搭建方法: 1. 安装并配置Python环境:Battery Historian是基于Python开发的,首先需要安装Python环境。可以从Python官方网站下载最新版本的Python并进行安装,在安装过程中记得勾选"Add Python to PATH"选项。完成安装后,打开命令提示符窗口,输入"python --version"来确认Python是否安装成功,并且能够显示相应的版本号。 2. 下载Battery Historian代码:在Battery Historian的GitHub仓库中,找到并下载最新版本的代码。可以直接在浏览器中访问"https://github.com/google/battery-historian",然后点击"Clone or download"按钮进行下载。下载完成后,将代码解压到合适的目录中。 3. 安装必要的依赖库:在命令提示符窗口中切换到Battery Historian代码所在的目录,并使用pip install命令来安装必要的依赖库。例如,可以执行"pip install -r requirements.txt"命令来安装所有需要的依赖库。 4. 运行Battery Historian:在命令提示符窗口中切换到Battery Historian代码所在的目录,并执行"python historian.py"命令来启动Battery Historian。启动成功后,命令提示符窗口会显示"Running on"的信息,表示Battery Historian已成功运行。此时,可以在浏览器中输入"http://localhost:9999"来访问Battery Historian的Web界面,并开始分析Android设备的电池使用情况。 以上就是使用Battery Historian的搭建方法。需要注意的是,Battery Historian只能分析Android设备的电池使用情况,因此在使用之前,需要将Android设备连接到电脑上,并确保设备已开启开发者选项,并开启USB调试模式。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值