LinuxCommandLibrary

adb-logcat

TLDR

View device logs

$ adb logcat
copy
Filter by priority level (Verbose, Debug, Info, Warn, Error, Fatal)
$ adb logcat *:[E]
copy
Filter by tag and priority
$ adb logcat [ActivityManager]:I *:S
copy
Clear the log buffer
$ adb logcat -c
copy
View logs from specific buffer
$ adb logcat -b [main|system|crash|events]
copy
Save logs to file
$ adb logcat -f [logfile.txt]
copy

SYNOPSIS

adb logcat [-v format] [-b buffer] [-c] [-f file] [filter-spec]

DESCRIPTION

adb logcat displays the Android system log in real-time. It shows log messages from the system, apps, and various Android components. The output includes timestamp, process ID, thread ID, priority level, tag, and message.
Filter expressions allow you to select which log messages to display based on tag name and minimum priority level. Multiple filters can be combined to create complex filtering rules.

PARAMETERS

-v format

Output format: brief, process, tag, thread, raw, time, threadtime, long
-b buffer
Log buffer: main, system, radio, events, crash, all
-c
Clear the log buffers
-d
Dump log and exit (don't block)
-f file
Write output to file
-s
Set default filter to silent (equivalent to *:S)
-e regex
Only print lines matching regex
--pid=pid
Only show logs from specified process ID

FILTER FORMAT

$ - **V**: Verbose
- **D**: Debug
- **I**: Info
- **W**: Warning
- **E**: Error
- **F**: Fatal
- **S**: Silent (suppress output)
copy

CAVEATS

Log buffers have limited size; old messages are overwritten. Some system logs may require root access. Excessive logging can slow down the device. Use filters to reduce output volume.

HISTORY

Logcat has been part of the Android SDK since the initial release in 2008, based on the Linux kernel's printk logging system but adapted for Android's needs with tag-based filtering.

SEE ALSO

adb(1), dmesg(1), journalctl(1)

Copied to clipboard