入门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

adb logcat 基本用法的更多相关文章

  1. adb Logcat用法

    转自: http://blog.csdn.net/tiantianshangcha/article/details/6288537 个人认为有一下几个常用命令: adb logcat -b radio ...

  2. adb logcat 命令行用法

    作者 :万境绝尘  转载请著名出处 eclipse 自带的 LogCat 工具太垃圾了, 开始用 adb logcat 在终端查看日志; 1. 解析 adb logcat 的帮助信息 在命令行中输入  ...

  3. android的logcat详细用法

    Android日志系统提供了记录和查看系统调试信息的功能.日志都是从各种软件和一些系统的缓冲区中记录下来的,缓冲区可以通过 logcat 命 令来查看和使用. 使用logcat命令 你可以用 logc ...

  4. 如何过滤 adb logcat 输出

    对原作者表示感谢,转自博客:http://www.otechu.me/zh/2011/12/filtering-adb-logcat-output/ 本文介绍如何在 shell 命令行中过滤 adb ...

  5. adb logcat 查看日志

    使用 logcat 命令 查看和跟踪系统日志缓冲区的命令logcat的一般用法是: [adb] logcat [<option>] ... [<filter-spec>] .. ...

  6. 【转】如何过滤 adb logcat 输出

    原文网址:http://www.cnblogs.com/imouto/archive/2012/12/11/filtering-adb-logcat-output.html 简介: 本文介绍如何在 s ...

  7. Android NDK 开发中 adb logcat 命令的使用

    一.LogCat 存储在一个叫做 circular memory buffers 的缓冲中. 平时常用的都是通过eclipse 自带的 logcat 插件查看 logcat ,其实也可以通过命令来导出 ...

  8. 几种在shell命令行中过滤adb logcat输出的方法

    我们在Android开发中总能看到程序的log日志内容充满了屏幕,而真正对开发者有意义的信息被淹没在洪流之中,让开发者无所适从,严重影响开发效率.本文就具体介绍几种在shell命令行中过滤adblog ...

  9. Android命令行工具logcat详细用法!

    logcat是Android中一个命令行工具,可以用于得到程序的log信息. 见板凳详细说明!     本贴内容来自网络,引用网址为:http://hi.baidu.com/%C9%C1%D2%AB% ...

随机推荐

  1. iOS开发中如何使自定义方法具有XCode插件使用提示

    iOS开发中难免要安装一些好用的插件,然而插件在使用时往往只对系统的方法有提示作用,而自己写的方法不能用上插件的便利. 其实还是有办法使插件对自定义的方法有效: 1. 首先知道Xcode的插件安装路径 ...

  2. ios 返回指定导航控制器

    UINavigationController *navigationVC = self.navigationController; NSMutableArray *viewControllers = ...

  3. iOS之 FBMemoryProfiler FB的循环引用检测工具

    经过两天的google终于搞定了FBMemoryProfiler这个开源检测循环引用的工具.中间的曲折也是让人头疼,言归正传直接说一下这个memoryProfiler github:https://g ...

  4. Mysql查询按照某字段指定顺序排序

    在项目当中用到Sphinx的时候,很多人遇到了这样的问题:使用mysql+Sphinx检索出了相关度的ID后,如何按照指定ID在Mysql中进行排序呢?这里是我在项目中的解决方法: 1 SELECT ...

  5. 如何开启win7端口的图文教程

    Windows 7/Vista/XP/2003等系统中的远程终端服务是一项功能非常强大的服务,下面来教教大家如何开启端口:打开“控制面板”中的“Windows防火墙”,点击左侧的“高级设置” 右击“入 ...

  6. Java开发第一步:JDK 7 安装及配置

    JDK 7 安装及配置1. 打开网页http://www.oracle.com 下载对应平台的合适 JDK. 2. 双击下载的 exe,如 jdk-7u7-windows-i586.exe.3. 进入 ...

  7. CMMI4级实践中的5个经典问题及解答

    这五个问题相当经典而且比较深,需要做过CMMI4.5级的朋友才能看懂这些问题.这5个问题是一位正在实践CMMI4级的朋友提出来的,而解答则是我的个人见解. 五个疑问是:   A.流程,子流程部分不明白 ...

  8. git将代码提交到远程分支(非主分支)

    一个仓库可以包含多个分支,有一个默认的主分支:master 若想提交代码至远程仓库的某个分支(非主分支) 先查看下本地分支以及远程分支:git branch -a 由本地分支(非主分支master)提 ...

  9. 大家一起和snailren学java-(13)字符串

    “好久没有写这个系列了.其实也有在看,不过觉得一些很基本的都写上来没意思.现在打算的是将整本书看完后,最后整合为一篇blog,筛选出一些平时没有注意到的或者更深入的理解” 在写程序中,字符串Strin ...

  10. mysql metadata lock(二)

    上一篇<mysql metadata lock(一)>介绍了为什么引入MDL,MDL作用以及MDL锁导致阻塞的几种典型场景,文章的最后还留下了一个小小的疑问.本文将更详细的介绍MDL,主要 ...