Logcat 参数及功能介绍

个人最常用的logcat 指令大致就有 -c , -t, -v, 但有个新需求,需要获取近期 *min 内的LOG,那么通过logcat -h 就可以展示具体有哪些指令,一起学习记录一下.

rk3288:/ $ logcat -h
Usage: logcat [options] [filterspecs]
options include:
  -s              Set default filter to silent. Equivalent to filterspec '*:S'
  -f , --file=               Log to file. Default is stdout
  -r , --rotate-kbytes=
                  Rotate log every kbytes. Requires -f option
  -n , --rotate-count=
                  Sets max number of rotated logs to , default 4
  --id=       If the signature id for logging to file changes, then clear
                  the fileset and continue
  -v , --format=
                  Sets log print format verb and adverbs, where  is:
                    brief help long process raw tag thread threadtime time
                  and individually flagged modifying adverbs can be added:
                    color descriptive epoch monotonic printable uid
                    usec UTC year zone
                  Multiple -v parameters or comma separated list of format and
                  format modifiers are allowed.
  -D, --dividers  Print dividers between each log buffer
  -c, --clear     Clear (flush) the entire log and exit
                  if Log to File specified, clear fileset instead
  -d              Dump the log and then exit (don't block)
  -e , --regex=
                  Only print lines where the log message matches 
                  where  is a regular expression
  -m , --max-count=
                  Quit after printing  lines. This is meant to be
                  paired with --regex, but will work on its own.
  --print         Paired with --regex and --max-count to let content bypass
                  regex filter but still stop at number of matches.
  -t       Print only the most recent  lines (implies -d)
  -t '

在ADB窗口使用

你可能感兴趣的:(android,java)