Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Android ADB Logcat Command Reference

Tech May 14 15

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

Related Articles

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

SBUS Signal Analysis and Communication Implementation Using STM32 with Fus Remote Controller

Overview In a recent project, I utilized the SBUS protocol with the Fus remote controller to control a vehicle's basic operations, including movement, lights, and mode switching. This article is aimed...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.