ChkBugReport工具for Android

来源:互联网 发布:注册淘宝账号需要什么 编辑:程序博客网 时间:2024/06/07 20:32

关于这个工具,找到的资料都比较旧了,貌似是索尼移动的开发人员开发的,2014年左右的文章比较多,应该是那个时候索尼移动还是比较鼎盛的时期吧。现在已经很少看到关于这个工具的文章了,Github上最新版本是216,5个月之前修改的,应该是工具比较稳定健壮了,不需要太大的修改量了。



官方网站:http://developer.sonymobile.com/knowledge-base/tools/analyse-your-bugreports-with-our-open-source-tool/
开源地址:https://github.com/sonyxperiadev/ChkBugReport


官网是这样介绍的:ChkBugReport is a new bugreport analysis tools released as open source .
      下面一段翻译自这里:安卓的开发者们,你们还在为经常碰到的ANR而感到头疼和不爽么,还在为应用崩溃而抓耳挠腮么?还在因为收集到的错误日志杂乱无章而感到束手无策么?ChkBugReport将为你解忧愁,解心宽,解决各种小困难。ChkBugReport,简单易用,简直是居家旅行,工作生活必备之良品。
  • 点击查看ChkBugReportin源码。
  • 点击查看 ChkBugReport.jar下载地址。
  • 点击information 查看相关说明 。
ChkBugReport Usage
it’s quite easy to use the tool:
  • Create a bugreport (for example when you receive an ANR message) by executing
  1. adb shell bugreport > bugreport.txt
复制代码
  • Execute ChkBugReport:
  1. java –jar chkbugreport.jar bugreport.txt
复制代码
  • Open the “bugreport_out/index.html” in a browser.


If you are using Linux or Mac OSX, you could use the wrapper script,and it;s name is chkbug# ChkBugReport
  1. # $1 is the name of bugreport, e.g: bugreport.txt
  2. adb shell bugreport > $1

  3. #chkbug is the wrapper scirpt introduced above.
  4. chkbug $1

  5. #auto open folder when scripte is completed.
  6. nautilus $1</font>
复制代码
当然你也可以把上述命令整理到一个脚本中,以为Ubuntu OS为例
  • 可以用 vi 新建一个叫 adbug 的文件,内容如下:# ChkBugReport 
  1. # $1 is the name of bugreport, e.g: bugreport.txt
  2. adb shell bugreport > $1

  3. #chkbug is the wrapper scirpt introduced above.
  4. chkbug $1

  5. #auto open folder when scripte is completed.
  6. nautilus $1</font>
复制代码
    2. 为 adbug 授予执行权限
  1. chmod +x adbug
复制代码

准备工作完毕,现在可以进行测试了。
  • 新建一个Android Project , 在代码中制造一个空指针(这个我们最擅长了)。
  • 在模拟器,机顶盒,手机(whatever)中运行程序(哦,天啊,竟然出错了!)
  • 执行 脚本 adbug buglog.txt
运行完毕后会自动打开文件夹,可以看到一个叫 buglog_out 的文件夹。里面是以HTML格式显示的日志信息。

写在最后:上述所有操作已在Ubuntu 与 Windows 上实践过,如有疑问请仔细阅读帮助文档 。

其他的中文使用帮助如下:
http://blog.csdn.net/chenzhiqin20/article/details/12506227

0 0