Android ADB Logcat Command Reference
System Preparation
Insure the Android SDK Platform-Tools directory is accessible via system PATH. Enable USB debugging on the mobile device and verify the connection status.
adb devices
Exporting Logs
Redirect standard output to a host machine file or a device partition depending on the environment.
# Save directly to internal storage
adb logcat -s W >> /sdcard/debug_report.log
# Save to local development machine
adb logcat *:D > ./capture.txt
Append timestamps to entries using format specifiers for better analysis.
adb logcat -v time -s com.example.app:E > ./time_stamped.log
Terminate the streaming process by sending an interrupt signal.
Log Priorities
Messages are categorized by severity levels ranging from detailed traces to silent suppression.
| Level | Descriptoin |
|---|---|
| V | Verbose (Lowest) |
| D | Debug |
| I | Info |
| W | Warning |
| E | Error |
| F | Fatal |
| S | Silent |
Retrieve only high-severity entries.
adb logcat *:E
Isolate logs from a specific application while suppressing other tags.
adb logcat -v short com.example.app:I *:S
Syntax Expressions
Construct filters using the tag:priority format. Use asterisks to match all tags.
adb logcat ActivityManager:I *:S
adb logcat *:W
Output Variants
Customize the metadata display style accompanying the log messages.
adb logcat -v long
Supported modes include brief, process, tag, thread, raw, time, and long.
Buffered Zones
Access distinct circular buffers maintained by the operating system.
adb logcat -b system
Common zones available are main, radio, events, and security. The default buffer is main.
Administrative Options
Clear existing log data from memory.
adb logcat -c
Display the current log size statistics.
adb logcat -g
Configure automatic file rotation based on count and size limits.
adb logcat -f rotated.log -n 5 -r 1M