Capture, Export, and Analyze Android Crash Logs Using ADB Logcat

12 min read Learn step‑by‑step how to grab crash logs from any Android device with ADB, export them safely, and turn raw logcat output into actionable debugging information – all without rooting. October 10, 2026 02:30 How to Capture, Export, and Analyze Android Crash Logs Using ADB Logcat (No Root)

When an app suddenly closes with a "Unfortunately, AppName has stopped" dialog, the first place to look is the crash log. Android’s built‑in logging system – logcat – records every event, error, and stack trace that the operating system and apps emit. With the Android Debug Bridge (ADB) you can pull those logs from any device, even if you don’t have root access.

Why ADB Logcat Is Your Best First‑Line Debug Tool

Logcat works at the kernel and framework level, so it captures crashes that the Play Store’s “Report” button may never send. Because it runs on the host PC, you can apply powerful text‑processing tools (grep, awk, sed) to isolate the exact exception, thread, and method that caused the failure. The workflow we’ll cover works on Android 6.0+ and on most OEM skins, without needing to enable developer‑only options beyond USB debugging.

Before You Start

  • Computer with ADB installed – Windows, macOS, or Linux. If you haven’t installed the platform‑tools, download them from the official Android developer site and add the folder to your system PATH.
  • USB cable – Use the cable that came with your phone; cheap charge‑only cables won’t transmit data.
  • Battery charge – Keep the device above 30 % to avoid an unexpected shutdown during log capture.
  • Enable USB debugging – Settings > About phone > Tap "Build number" seven times, then Settings > System > Developer options > USB debugging.
  • Know the app package name – You’ll need it for filtering. You can find it in Play Store URL or by running adb shell pm list packages | grep -i appname.

Step‑by‑Step: Capturing a Crash Log

1. Connect the device and verify the connection

  1. Plug the phone into the computer via USB.
  2. Open a terminal (Command Prompt, PowerShell, or Terminal app).
  3. Run adb devices. You should see a line like 0123456789ABCDEF device. If you see unauthorized, unlock the phone and tap "Allow" on the USB‑debugging prompt.

2. Reproduce the crash

Open the app that is crashing and perform the action that triggers the failure. Keep the terminal open – we’ll start logcat before the crash so the stack trace is captured.

3. Start a filtered logcat session

Run the following command, replacing com.example.app with the target package name:

adb logcat --pid=$(adb shell pidof -s com.example.app) *:E -v threadtime

This command does three things:

  • --pid limits output to the process that belongs to the app, removing unrelated system chatter.
  • *:E shows only entries with error priority (E) or higher, which includes uncaught exceptions.
  • -v threadtime prints timestamps, PID, TID, and tag – essential for later analysis.

Leave this terminal window running. When the crash dialog appears, logcat will automatically dump the stack trace.

4. Save the log to a file

Instead of watching the stream, you can pipe it directly to a file for later review:

adb logcat --pid=$(adb shell pidof -s com.example.app) *:E -v threadtime > crash_log.txt

After the app crashes, press Ctrl +C to stop logging. The file crash_log.txt now contains the raw log.

5. Verify the captured log

Open the file with any text editor. The last few lines should include a FATAL EXCEPTION block, similar to:

04-12 14:23:45.678  1234  1234 E AndroidRuntime: FATAL EXCEPTION: main
04-12 14:23:45.678  1234  1234 E AndroidRuntime: Process: com.example.app, PID: 1234
04-12 14:23:45.678  1234  1234 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke …
    …

If you don’t see a FATAL EXCEPTION line, the crash may have occurred in a native library. In that case, capture the full log (omit the *:E filter) and look for signal 11 (SIGSEGV) entries.

Understanding the Logcat Output

A typical crash block contains four key parts:

  1. Timestamp – When the exception happened. Useful for correlating with user reports.
  2. PID/TID – Process and thread IDs. The main thread is usually labelled main.
  3. Tag – Usually AndroidRuntime for Java crashes, or the native library name for C/C++ crashes.
  4. Message – The exception type, message, and stack trace.
    • The first line tells you the exception class (e.g., java.lang.IllegalStateException).
    • Subsequent lines list the call stack, from the deepest method up to the entry point.

Copy the full stack trace (including the at … lines) into your IDE’s search to jump directly to the offending source file.

Advanced Filtering Techniques

Sometimes the app spawns background services that also generate errors, making the log noisy. Here are a few filters you can add to narrow the view:

  • Tag filter: adb logcat -s AndroidRuntime:E MyAppTag:W – shows only AndroidRuntime errors and warnings from your custom tag.
  • Keyword grep: adb logcat | grep -i "nullpointerexception" – useful when you only know the exception name.
  • Time window: adb logcat -T "04-12 14:23:00.000" – starts logging from a specific timestamp, handy for long‑running sessions.

Exporting the Log for Remote Analysis

If you need to share the crash log with a developer or a support forum, compress it first to preserve formatting:

zip crash_log_$(date +%Y%m%d_%H%M%S).zip crash_log.txt

Upload the zip to a trusted file‑sharing service or attach it to an email. Remember to redact any personal data that may appear in the log (e.g., device identifiers, user IDs).

Troubleshooting Common Issues

Logcat Returns Nothing

  • Check USB debugging: Ensure the prompt on the device is accepted.
  • Device not authorized: Run adb kill-server && adb start-server then reconnect.
  • Wrong PID: Some OEMs hide the process name. Use adb shell ps | grep com.example.app to get the numeric PID and substitute it manually.

Log Is Overwhelmingly Large

  • Remove the *:E filter only after you’ve confirmed the crash is captured.
  • Use -b radio or -b events to select a specific log buffer if you only need system events.

Native Crash (SIGSEGV) Not Visible

  • Run a full log without filters: adb logcat -v threadtime > full_log.txt.
  • Search for signal 11 (SIGSEGV) or Fatal signal 11. The lines following will point to the native library (.so) that crashed.

Alternative: Using Android Studio’s Logcat Viewer

If you already have Android Studio installed, you can capture logs without the command line:

  1. Open Android Studio, choose "Logcat" at the bottom.
  2. Select your device and the target app from the dropdown.
  3. Click the "Save Log" icon (floppy disk) to export the current view.

The graphical view lets you apply the same filters (by tag, level, or PID) with a click, and you can copy the stack trace directly into the IDE for quick navigation.

Putting It All Together – A Sample Workflow

  1. Enable USB debugging and connect the phone.
  2. Identify the package name: adb shell pm list packages | grep -i myapp.
  3. Start filtered logging to a file: adb logcat --pid=$(adb shell pidof -s com.mycompany.myapp) *:E -v threadtime > myapp_crash.txt.
  4. Reproduce the crash on the device.
  5. Press Ctrl +C to stop logging.
  6. Open myapp_crash.txt, locate the FATAL EXCEPTION block, and copy the stack trace.
  7. Paste the stack trace into Android Studio’s "Search Everywhere" to jump to the offending line.
  8. If the issue is in native code, repeat step 3 without the *:E filter and search for signal 11.
  9. Compress and share the log if you need external help.

Following this checklist ensures you capture the exact moment the app fails, dramatically reducing the time spent guessing what went wrong.

Safety and Privacy Considerations

  • Do not share logs publicly unless you have removed personal identifiers – logs can contain IMEI, MAC addresses, or user IDs.
  • Avoid writing logs to the device’s internal storage if the device is encrypted and you plan to hand it over; use the PC’s storage instead.
  • Running adb logcat does not modify the device, but keep the screen unlocked to prevent the device from sleeping and cutting the log stream.

With these steps you now have a reliable, repeatable method for capturing, exporting, and dissecting Android crash logs without ever rooting the phone. Whether you’re a developer debugging your own app or a power user helping a friend, logcat is the most transparent window into what Android is doing when things go wrong.

User Comments (0)

Add Comment
We'll never share your email with anyone else.