
How to read logcat when a manual test fails
A screenshot shows what went wrong. Logcat often shows why. This guide shows how to capture it, cut it down to your app and the failing moment, and put the right lines in the bug.
Start free trial 14 days, no card
1. Capture the log while you test
Connect the phone with USB debugging on and clear the old buffer first, so the log starts with your test: adb logcat -c. Then save everything while you test: adb logcat -v threadtime > test.log. The threadtime format adds the date, time, process and thread to each line, which you need to line the log up with your screen.
2. Keep only your app
Find your app's process id with adb shell pidof com.example.shop and filter on it: adb logcat -v threadtime --pid=$(adb shell pidof com.example.shop). The pid changes when the app restarts, so for a test that kills or reinstalls the app, filter the saved file by the package name and tags instead.
3. Go to the moment it broke
Note the clock time when the screen went wrong, then look at the lines a few seconds before it. Look for, in this order:
- Crashes:
FATAL EXCEPTIONand the stack trace below it. The first line that names your app's package is usually where to start. - App not responding:
ANR infrom ActivityManager. - Errors and warnings from your app's tags, lines with level
EorW. - Network: HTTP status codes or timeouts logged by your networking library.
- Your app's own debug lines: values like a total, a discount or a state that disagree with what the screen shows.
4. Put it in the bug
Paste 5 to 20 lines around the moment, not the whole file, and say which line matters. Add the device, Android version and app build. A developer can then go from your report to the code without asking you to reproduce it.
Doing it without the terminal
OfeliQA records logcat during a Sweep and lines it up with the video. When a scenario fails, it shows the log lines around that moment and suggests the likely cause, so the steps above happen for you.
Try it on your own app
Every plan includes Sweep and the rest of OfeliQA. See pricing, or start the 14-day trial: no card needed.