Bugreport 抓取

前言

主要介绍怎么抓取 bugreport 用于分析异常唤醒什么的

分析可参考:
https://github.com/google/battery-historian

流程

测试之前手机连接usb打开usb调试开关执行以下命令
    a、adb shell dumpsys batterystats --reset
    b、adb shell dumpsys batterystats --enable full-wake-history
    
测试结束后执行下面命令输出 bugreport
    adb bugreport  >  bugreport.txt
    
解析位置:需翻墙
    https://bathist.ef.lc/

本地安装解析服务流程

1)安装 Go 语言
    下载:https://golang.org/doc/install
    配置环境变量:
        GOROOT 
        C:\Go                   // 安装目录 
        
        GOPATH
        %GOROOT%\workspace
        
        path                
        %GOROOT%\bin            // 添加到环境变量中 
        
   检查是否安装成功:cmd 执行 “go version”         
   
(2)安装 Python        
    下载:https://www.python.org/ 【注意仅支持 python 2.7,python3.0改变很大】
    配置环境变量:
        path 
        D:\Python27             // 安装目录
    
    检查是否安装成功:cmd 执行 “python –V”【注意是大写V】      


(3)安装Git                                     
    下载:https://git-scm.com/
    配置环境变量:
        path
        C:\Program Files\Git\bin
        
    检查是否安装成功:cmd 执行 “git version”
    
    
(4)安装 Java 环境   
    
(5)下载 Battery Historian 源码并且运行    

    mingw64 执行“go get -d -u github.com/google/battery-historian/...”【注意最后有三个点】
    
    cmd 运行 Battery Historian
        C:\Go\workspace\src\github.com\google\battery-historian>go run setup.go         // 【第一次执行要下载,时间会久一些,以后就快些】
    
    cmd 执行“go run cmd/battery-historian/battery-historian.go”
    
    登录网址 http://localhost:9999 查看是否运行
    
    
二、使用

1、运行 Battery Historian

    在上面 Building from source code 均配置成功的情况下:

        进入到 “$GOPATH/src/github.com/google/battery-historian” 目录下方
        cmd 执行“go run setup.go”
        cmd 执行“go run cmd/battery-historian/battery-historian.go”    
    
    测试之前手机连接usb打开usb调试开关执行以下命令
        a、adb shell dumpsys batterystats --reset
        b、adb shell dumpsys batterystats --enable full-wake-history
        
    测试结束后执行下面命令输出 bugreport
        adb bugreport  >  bugreport.txt
    
    浏览器访问:
        http://localhost:9999/
    
    
    
    
    
    
源码位置: https://github.com/google/battery-historian    
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值