您的位置:首页 > 其它

adb 查看日志信息

2015-06-05 17:16 309 查看

adb logcat 详解

  [b](1) 下面命令将只会显示AndroidRuntime类型的Error消息:[/b]

adb logcat -s AndroidRuntime

  (2) 显示全部日志信息:adb logcat

(3) 显示某一TAG的日志信息:adb logcat -s TAG名称

(4) 显示某一TAG的某一级别的日志信息:adb logcat TAG名称:级别.....TAG名称:级别 *:S

注:日志级别(V-verbose,D-debug,I-info,W-warning,E-error,F-fatal,S-silent),*:S(确保日志输出的时候是按照过滤器的说明限制)

(5) 显示某一级别以上的全部日志信息:adb logcat *:级别

(6) 以某种格式显示日志信息:adb logcat -v 格式

注:日志格式(brief,process,tag,thread,raw,time,long)

(7) 显示缓冲区中的日志信息:adb logcat -b 缓冲区类型

注:缓冲区类型(radio-无线缓冲区,events-事件缓冲区,main-主缓冲区,默认)

(8) 清理已经存在的日志:adb logcat -c

(9) 将日志显示在控制台后退出:adb logcat -d

(10) 将日志输出到文件:adb logcat -f 文件名

注:DDMS的LogCat中文乱码:修改MultiLineReceiver类中的addOutput()方法,将其中的"ISO-8859-1"改成"UTF-8",重新编译源码。

 

实例: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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: