adb logcat命令使用
Usage: logcat [options] [filterspecs]
options include:
-s Set default filter to silent.
Like specifying filterspec '*:S'
-f <filename> Log to file. Default is stdout
-r <kbytes> Rotate log every kbytes. Requires -f
-n <count> Sets max number of rotated logs to <count>, default 4
-v <format> Sets the log print format, where <format> is:
brief color long printable process raw tag thread
threadtime time usec
-D print dividers between each log buffer
-c clear (flush) the entire log and exit
用法: logcat [选项] [过滤条件]
选项包括:
-s 设置默认过滤器为静默方式. 就像指定如下过滤器 '*:S'
-f <filename> 记录到文件. 默认是标准输出
-r <kbytes> Rotate log every kbytes. Requires -f
-n <count> Sets max number of rotated logs to <count>, default 4
-v <format> 设置日志输出格式, 其中 <format> 可以是:
brief color long printable process raw tag thread
threadtime time usec
-D 在每个日志缓冲区之间打印分隔符
-c 清除(刷新)整个日志并退出
如
# 打印logcat日志
adb logcat -v time
# 打印logcat日志到文件
adb logcat -v time | tee logcat.txt
# 清空Android日志log
adb logcat -c