日期:2014-05-16 浏览次数:20476 次
作者 : 万境绝尘 转载请著名出处
eclipse 自带的 LogCat 工具太垃圾了, 开始用 adb logcat 在终端查看日志;
在命令行中输入 adb logcat --help 命令, 就可以显示该命令的帮助信息;
octopus@octopus:~$ adb logcat --help Usage: logcat [options] [filterspecs] options include: -s Set default filter to silent. Like specifying filterspec '*:s' -f <filename> Log to file. Default to stdout -r [<kbytes>] Rotate log every kbytes. (16 if unspecified). Requires -f -n <count> Sets max number of rotated logs to <count>, default 4 -v <format> Sets the log print format, where <format> is one of: brief process tag thread raw time threadtime long -c clear (flush) the entire log and exit -d dump the log and then exit (don't block) -t <count> print only the most recent <count> lines (implies -d) -g get the size of the log's ring buffer and exit -b <buffer> Request alternate ring buffer, 'main', 'system', 'radio' or 'events'. Multiple -b parameters are allowed and the results are interleaved. The default is -b main -b system. -B output the log in binary filterspecs are a series of <tag>[:priority] where <tag> is a log component tag (or * for all) and priority is: V Verbose D Debug I Info W Warn E Error F Fatal S Silent (supress all output) '*' means '*:d' and <tag> by itself means <tag>:v If not specified on the commandline, filterspec is set from ANDROID_LOG_TAGS. If no filterspec is found, filter defaults to '*:I' If not specified with -v, format is set from ANDROID_PRINTF_LOG or defaults to "brief"
adb logcat 命令格式 : adb logcat [选项] [过滤项], 其中 选项 和 过滤项 在 中括号 [] 中, 说明这是可选的;
选项解析 :
-- "-s"选项 : 设置输出日志的标签, 只显示该标签的日志;
-- "-f"选项 : 将日志输出到文件, 默认输出到标准输出流中, -f 参数执行不成功;
-- "-r"选项 : 按照每千字节输出日志, 需要 -f 参数, 不过这个命令没有执行成功;
-- "-n"选项 : 设置日志输出的最大数目, 需要 -r 参数, 这个执行 感觉 跟 adb logcat 效果一样;
--