入门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. eclipse编码格式设置

    大家好,我是小Alan,很高兴大家能够看到这篇小小的技术点文章,这还是从参加工作以来,小Alan写的第一篇博文.喜欢能够给一些朋友带来方便. 说到eclipse编码格式的设置其实一个非常非常小的事情, ...

  2. mysql命令(数据库备份与恢复)

    本地: 1.进入MySQL目录下的bin文件夹:e:回车: e:\>cd mysql\bin? 回车 2.导出数据库:mysqldump -u 用户名 -p 数据库名 > 导出的文件名 范 ...

  3. WPF学习之路(八)页面

    传统的应用程序中有两类应用程序模式:桌面应用,Web应用.WPF的导航应用程序模糊了这两类应用程序的界限的第三类应用程序 WPF导航表现为两种形式,一是将导航内容寄宿于窗口,二是XAML浏览器应用程序 ...

  4. jQuery设置disabled属性

    先比较下readOnly和disabled: readOnly 只针对input(text/ password)和textarea有效: disabled 对于所有的表单元素都有效,包括select, ...

  5. HashSet vs TreeSet vs LinkedHashSet

    使用Set集合的主要原因是因为Set集合里面没有重复的元素.Set集合有三个常见的实现类:HashSet,TreeSet,LinkedHashSet.什么时候,选择哪一个使用非常重要.简单的说,如果你 ...

  6. Hibernate 缓存介绍

    Hibernate中提供了两级缓存,一级缓存是Session级别的缓存,它属于事务范围的缓存,该级缓存由hibernate管理,应用程序无需干预:二级缓存是SessionFactory级别的缓存,该级 ...

  7. .NET领域驱动设计—实践(穿过迷雾走向光明)

    阅读目录 开篇介绍 1.1示例介绍 (OnlineExamination在线考试系统介绍) 1.2分析.建模 (对真实业务进行分析.模型化) 1.2.1 用例分析 (提取系统的所有功能需求) 1.3系 ...

  8. 0020 Java学习笔记-面向对象-变量

    变量分为哪些 成员变量:类里面,方法外面定义的变量 实例变量:没有用static修饰的变量,属于对象:存在期:创建实例-销毁实例:作用域:与该实例的生存范围相同 类变量:用static修饰的变量,属于 ...

  9. Linux[Fedora]查找文件包含的字段

    find 与 grep组合查找 find . –name '文件类型' | xargs grep –n '查找内容'文件类型可正则表达式通配, [.]表示当前目录下进行查找,也可自由指定目录.比如: ...

  10. mysql 触发器的创建 修改 删除

    //做一个简单的练习,创建一个简单的触发器 完成添加文章的时候,自动加上时间,默认作者 为 ‘日记本的回忆‘ show columns from test; //查看表结构 //查看已存在触发器 sh ...