Intermediate 6 min read Updated: 2026-08-25

How to Capture, Filter, and Export Android Logcat Logs

Master logcat filtering by tag, priority, process ID (PID), crash buffers, and export clean log files for debugging.

Prerequisites & Requirements

  • Android device connected via ADB

Step-by-Step Instructions

1

Filter by Error Priority Only (*:E)

Hides verbose, debug, and info logs.

adb logcat *:E
2

Filter by App Tag Name

Shows only logs produced with a specific Log tag.

adb logcat -s "MyActivity:D"
3

Filter by Specific Process ID (PID)

Streams logs generated exclusively by your application process.

adb logcat --pid=$(adb shell pidof -s com.example.app)
4

Dump Crash Stack Traces to File

Flushes and saves recent unhandled Java exceptions and native crashes.

adb logcat -b crash -d > crashes.log