Android ANR Debugging
An ANR says the required work did not finish on time. The investigation is to determine whether the target thread was busy, blocked, unscheduled or waiting on a failing dependency.
01
Classify the ANR
Input dispatch, broadcast, service and provider timeouts follow different execution paths. Record the reason and affected process before reading stacks.
02
Use the matching ANR trace
Newer Android releases keep multiple files under /data/anr. The matching trace gives thread states around the event and is often more useful than generic bugreport stack dumps.
03
Check system-wide pressure
A main thread can miss a deadline because of system_server latency, binder saturation, memory pressure or storage stalls. PSI, lmkd and process state help distinguish app-local work from system-wide degradation.