- Home
- Skills
- Mobile Development
- Android ANR Analyzer: Find What Froze the Main Thread
Android ANR Analyzer: Find What Froze the Main Thread
Reads an Android ANR trace and names what blocked the main thread (lock holder, deadlock, disk, network, binder, runBlocking), then fixes your code.
$1
Android ANR Analyzer: Find What Froze the Main Thread
Example session with this skill installed
My point-of-sale app shows "isn't responding" when I open the cart. Here's the trace I pulled from /data/anr. What's wrong?
- Read your context and instructions
- Compiled the android anr analyzer
Verdict: blocked on a lock
The main thread waits for a lock that thread "DefaultDispatcher-worker-3" holds while doing SharedPreferences commit.
Lock: 0x0d9b2f1a (java.lang.Object)
Held by: "DefaultDispatcher-worker-3" (tid 23), doing SharedPreferences commit, at CartRepository.persist(CartRepository.kt:73)
Your code on the main thread:
- CartRepository.items(CartRepository.kt:41)
- CartViewModel.refresh(CartViewModel.kt:57)
- MainActivity.onResume(MainActivity.kt:88)
Fix: CartRepository.add() holds lock while it commit()s the cart to disk, and items() needs the same lock on the main thread. Guard only the list change and save a snapshot outside the lock with apply() (or DataStore) on Dispatchers.IO:
val snapshot = synchronized(lock) { items += item; items.toList() }
scope.launch(Dispatchers.IO) { store.save(snapshot) }
Verify: enable StrictMode detectDiskWrites in debug builds, then watch this ANR cluster in Android vitals after the release.
Connects securely to your tools. The creator never sees your data.
About this skill
An ANR means the main thread did not answer within its deadline: 5 s for input; 10 s (foreground) or 60 s (background) for a broadcast; 20 s (foreground) or 200 s (background) for a service. The trace is a dump of every thread at that moment. This skill reads it, finds what the main thread was stuck on, and turns that into a fix in the app's code.
One of these, as text:
- Play Console → Android vitals → ANRs → a cluster → the "main" thread stack (copy every thread if the page offers it: a lock holder lives in another thread).
- A bugreport:
adb bugreport→ theFS/data/anr/files, or theVM TRACES AT LAST ANRsection of the main text file. - A device you control:
adb shell ls /data/anrthenadb pull /data/anr/<file>(emulators and debuggable or rooted devices).
The ANR reason line (Subject:, Reason:, or ANR in ... Reason: in logcat) helps:
it says whether it was input, a broadcast, a service or a provider.
A trace is one moment: if the main thread is idle or the dump is partial, the skill says so and asks for more traces from the same cluster instead of guessing. Lock holders in another process (binder calls) are not in the app's trace. Native-only (NDK) stacks are shown but not interpreted.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
- Software
Python 3.8+
Permissions
File Scopes
The bundled script uses only the Python standard library, makes no network calls and writes only to the terminal.
What's inside
Frequently Asked Questions
New in Mobile Development
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Mobile Development.