adb logcat 基本用法

入门android ,至少需要了解 adb 吧,那么打 log 也是必不可少的了。

下面简单介绍一下 adb logcat 基本用法:

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 -v time -s videocamera

意思是说,会打印出 log 信息中时间,以及包含关键字 "videocamera" 的所有 log

C:\Users\Administrator>adb logcat -v time -s videocamera fulin
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
07-01 08:43:57.037 V/videocamera( 2329): VideoCamera onCreate!
07-01 08:43:57.039 I/videocamera( 2329): getExternalSdState() : removed
07-01 08:43:57.040 I/videocamera( 2329): getExternalState() : mounted
07-01 08:43:57.040 I/videocamera( 2329): Sdcard is exists ? false
07-01 08:43:57.157 V/videocamera( 2329): fulin onCreate Storage.getAvailableSpace() 1335459840
07-01 08:43:57.159 V/videocamera( 2329): fulin initThumbnailButton
07-01 08:43:57.170 D/videocamera( 2329): Thumbnail.getLastThumbnail >>>
07-01 08:43:57.204 E/videocamera( 2329): --------------readVideoPreferences---------------minutes = 600
07-01 08:43:57.205 E/videocamera( 2329): --------------readVideoPreferences----------quality6=10
07-01 08:43:57.207 E/videocamera( 2329): -----------------readVideoPreferences---------mCameraId=0
07-01 08:43:57.208 E/videocamera( 2329): -----------------readVideoPreferences---------quality7=10
07-01 08:43:57.209 V/videocamera( 2329): mDesiredPreviewWidth=640. mDesiredPreviewHeight=480
07-01 08:43:57.234 V/videocamera( 2329): startPreview
07-01 08:43:57.240 V/videocamera( 2329): videocamera--mParameters.setFocusMode(mFocusManager.getFocusMode())
07-01 08:43:57.265 D/videocamera( 2329): Thumbnail.getLastThumbnail <<< is null:false
07-01 08:43:57.269 V/videocamera( 2329): Video snapshot size is 3264x2448
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 176x144
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 320x240
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 352x288
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 480x368
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 640x480
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 720x480
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 800x600
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 864x480
07-01 08:43:57.376 D/videocamera( 2329): SupportedPreviewSizes : 1280x720
07-01 08:43:57.422 V/videocamera( 2329): updateSceneOnScreenIndicator isVisible falsemSceneIndicatorandroid.widget.ImageView@41acd0e0

 

转自:http://blog.csdn.net/fulinwsuafcie/article/details/8028572

posted @   鸭子船长  阅读(1326)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示