battery-historian github:
安卓官网:
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/