当前位置:   article > 正文

Bugreport 抓取_bugreport抓取命令

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
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

本地安装解析服务流程

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    
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/319086
推荐阅读
相关标签
  

闽ICP备14008679号