LinuxCommandLibrary

logcat

TLDR

View all logs

$ adb logcat
copy
Filter by tag
$ adb logcat -s [TAG]
copy
Filter by priority
$ adb logcat "*:[E]"
copy
Clear log buffer
$ adb logcat -c
copy
Output to file
$ adb logcat > [logfile.txt]
copy
Show specific buffer
$ adb logcat -b [main,system,crash]
copy
Format output
$ adb logcat -v [time]
copy

SYNOPSIS

logcat [options] [filter...]

DESCRIPTION

logcat displays Android system and application logs. It connects to an Android device or emulator via adb and streams log messages for debugging and analysis.
The tool supports filtering by tag, priority level, and buffer type. It's essential for Android development and troubleshooting.

PARAMETERS

-s tag

Filter to specific tag(s).
-b buffer
Log buffer (main, system, radio, events, crash).
-c
Clear log buffer.
-d
Dump log and exit.
-f file
Write to file.
-v format
Output format (brief, time, long, color).
-t count
Print last N lines.
-g
Get buffer size.
--pid pid
Filter by process ID.

PRIORITY LEVELS

V: Verbose
D: Debug
I: Info
W: Warning
E: Error
F: Fatal

CAVEATS

Requires adb connection. Buffer size limited. Old logs cleared on reboot. Some logs need root access.

HISTORY

logcat is part of the Android SDK, developed by Google. It has been the primary Android logging tool since Android's release in 2008, evolving to support more buffers and filtering options.

SEE ALSO

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

> TERMINAL_GEAR

Curated for the Linux community

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

BOSGAME Mini PC N95, Intel 12th Mini Computers| 16GB DDR4 RAM| 512GB M.2 2280 SSD| 4K 60HZ Triple Displays by Dual HDMI+Type-C, 6W TDP Quiet Mini PC, WIFI5, BT 5.0 Office

$239.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00
Raspberry Pi 5 8GB

Raspberry Pi 5 8GB

$134.50
nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95