Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Android ADB Logcat Command Reference

Tech May 14 1

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

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

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...

Leave a Comment

Anonymous

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