【Android电量】Battery Historian环境部署

简介: 1、Install Docker Desktop for Mac (ps: Requires Apple Mac OS Sierra 10.12 or above.)手动下载安装https://docs.

1、Install Docker Desktop for Mac (ps: Requires Apple Mac OS Sierra 10.12 or above.)
手动下载安装

https://docs.docker.com/docker-for-mac/install/

使用 Homebrew 安装

brew cask install docker(推荐)

2、Run the Battery Historian image.

使用命令

docker run -d -p 9999:9999 bhaavan/battery-historian 加载启动镜像 (有问题的镜像,不要用)

docker run -p 9998:9998 gcr.io/android-battery-historian/stable:3.0 --port 9998 (亲测可用镜像)

didi@localhost  ~  docker run -p 9998:9998 gcr.io/android-battery-historian/stable:3.0 --port 9998
Unable to find image 'gcr.io/android-battery-historian/stable:3.0' locally
3.0: Pulling from android-battery-historian/stable
c62795f78da9: Pull complete
d4fceeeb758e: Pull complete
5c9125a401ae: Pull complete
0062f774e994: Pull complete
6b33fd031fac: Pull complete
a6bd6e1d0bdb: Pull complete
76cf9d0635af: Pull complete
856d20d533e0: Pull complete
e63a73f6a528: Pull complete
1a75578c9353: Pull complete
24f3649604d9: Pull complete
10f637765748: Pull complete
e06a9fa76cf2: Pull complete
Digest: sha256:265a37707f8cf25f2f85afe3dff31c760d44bb922f64bbc455a4589889d3fe91
Status: Downloaded newer image for gcr.io/android-battery-historian/stable:3.0
2019/04/15 12:46:23 Listening on port: 9998
2019/04/15 12:48:19 Trace starting analysisServer processing for: GET
2019/04/15 12:48:19 Trace finished analysisServer processing for: GET
2019/04/15 12:48:20 Trace starting analysisServer processing for: GET
2019/04/15 12:48:20 Trace finished analysisServer processing for: GET
2019/04/15 12:48:27 Trace starting analysisServer processing for: POST
2019/04/15 12:48:27 Trace starting reading uploaded file. 2330165 bytes
2019/04/15 12:48:28 failed to extract battery info: could not find battery time info in bugreport
2019/04/15 12:48:28 failed to extract time information from bugreport dumpstate: open /usr/lib/go-1.6/lib/time/zoneinfo.zip: no such file or directory
2019/04/15 12:48:28 Trace started analyzing "bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-14-31-10.zip~bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-14-31-10/bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-14-31-10.txt" file.
2019/04/15 12:48:28 Trace finished processing checkin.
2019/04/15 12:48:28 Trace finished processing summary data.
2019/04/15 12:48:28 Trace finished generating Historian plot.
2019/04/15 12:48:28 Trace finished analyzing "bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-14-31-10.zip~bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-14-31-10/bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-14-31-10.txt" file.
2019/04/15 12:48:29 Trace ended analyzing file.
2019/04/15 12:48:29 Trace finished analysisServer processing for: POST

didi@localhost  /usr/local/Cellar/go/1.12.4/src/github.com/google/battery-historian   master  docker ps -all
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c19bb05d9198 bhaavan/battery-historian "/bin/sh -c 'go run …" 19 minutes ago Up 19 minutes 0.0.0.0:9999->9999/tcp sad_shaw
didi@localhost  /usr/local/Cellar/go/1.12.4/src/github.com/google/battery-historian   master 
didi@localhost  /usr/local/Cellar/go/1.12.4/src/github.com/google/battery-historian   master  docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
bhaavan/battery-historian latest 9a3a9fd0ca2f 2 years ago 922MB

3、Open BH
Run historian and visit http://localhost:9999
1

4、Upload Report

Both .txt and .zip bug reports are accepted.

To take a bug report from your Android device, you will need to enable USB debugging under Settings > System > Developer Options

To obtain a bug report from your development device running Android 7.0 and higher:

$ adb bugreport bugreport.zip

didi@localhost  ~  adb bugreport bugreport.zip
/data/user_de/0/com.android.shell/files/bugreports/bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-11-08-01.zip: 1 file pulled. 23.2 MB/s (2295220 bytes in 0.094s) // 手机本地

didi@localhost  ~  adb pull /data/user_de/0/com.android.shell/files/bugreports/bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-12-08-32.zip /Users/didi/Documents/ # 导出到电脑
/data/user_de/0/com.android.shell/files/bugreports/bugreport-ALP-AL00-HUAWEIALP-AL00-2019-04-15-12-08-32.zip: 1 file pulled. 24.1 MB/s (2415380 bytes in 0.096s)

For devices 6.0 and lower:

$ adb bugreport > bugreport.txt

5、Start analyzing!

Timeline:

2

System stats:
App stats:
目录
相关文章
|
7月前
|
编解码 Ubuntu Java
Android学习framework及搭建环境
Android学习framework及搭建环境
102 0
|
1月前
|
网络协议 关系型数据库 MySQL
安卓手机termux上安装MariaDB数据库并实现公网环境下的远程连接
安卓手机termux上安装MariaDB数据库并实现公网环境下的远程连接
|
2月前
|
开发工具 Android开发
安卓系统7.1搭建Xposed环境
安卓系统7.1搭建Xposed环境
28 1
|
7月前
|
Web App开发 开发工具 Android开发
Android平台不需要单独部署流媒体服务如何实现内网环境下一对一音视频互动
我们在做内网环境的一对一音视频互动的时候,遇到这样的技术诉求:如智能硬件场景下(比如操控智能硬件),纯内网环境,如何不要单独部署RTMP或类似流媒体服务,实现一对一音视频互动。
|
3月前
|
网络安全 Android开发
2023安卓逆向 -- 抓包环境设置(Charles+Postern)
2023安卓逆向 -- 抓包环境设置(Charles+Postern)
33 0
|
4月前
|
Java 编译器 开发工具
Android StudioJNI开发之NDK环境的搭建以及添加JNI支持(图文解释 简单易懂)
Android StudioJNI开发之NDK环境的搭建以及添加JNI支持(图文解释 简单易懂)
34 0
|
4月前
|
监控 Java 开发工具
基于Eclipse+SDK+ADT+DDMS的安卓开发环境完整搭建过程
基于Eclipse+SDK+ADT+DDMS的安卓开发环境完整搭建过程
45 0
基于Eclipse+SDK+ADT+DDMS的安卓开发环境完整搭建过程
|
7月前
|
IDE Java 开发工具
安卓开发环境
安卓开发环境
57 0
|
7月前
|
网络安全 开发工具 Android开发
qt 配置安卓开发环境
qt 配置安卓开发环境
73 0