Chinaunix首页 | 论坛 | 博客
  • 博客访问: 671993
  • 博文数量: 160
  • 博客积分: 2384
  • 博客等级: 大尉
  • 技术积分: 1366
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-01 11:35
文章分类
文章存档

2015年(45)

2014年(36)

2012年(28)

2011年(37)

2010年(2)

2009年(10)

2008年(2)

分类: Android平台

2014-12-06 14:47:45

The Android logging system provides a mechanism for collecting and viewing system debug  output. Logs from various applications and portions of the system are collected in a series of  circular buffers, which then can be viewed and filtered by the logcat command. You can use    logcat from an ADB shell to view the log messages.

For complete information about logcat options and filtering specifications, see   Reading and Writing Logs.

For more information on accessing logcat from DDMS, instead of the command line, see    Using DDMS.

Syntax


[adb] logcat [<option>] ... [<filter-spec>] ...

You can run logcat as an adb command or directly in a shell prompt  of your emulator or connected device. To view log output using adb, navigate to your SDK   platform-tools/ directory and execute:


$ adb logcat

You can create a shell connection to a device and execute:


$ adb shell # logcat

Options

The following table describes the command line options of logcat.

Option Description
-b  Loads an alternate log buffer for viewing, such as events or       radio. The main buffer is used by default. See Viewing Alternative Log Buffers.
-c Clears (flushes) the entire log and exits.
-d Dumps the log to the screen and exits.
-f  Writes log message output to . The default is       stdout.
-g Prints the size of the specified log buffer and exits.
-n  Sets the maximum number of rotated logs to . The default value      is 4. Requires the -r option.
-r  Rotates the log file every of output. The default value is      16. Requires the -f option.
-s Sets the default filter spec to silent.
-v  Sets the output format for log messages. The default is brief format. For a      list of supported formats, see Controlling Log Output      Format.
阅读(517) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~