/android-skills:android-debuggingfrom android-skills
Debug Android and KMP issues: crashes, ANRs, performance regressions, obfuscated release stack traces, and UI state bugs. Covers ANR trace collection, Perfetto baselines, and R8/ProGuard retrace workflows.
Ships in android-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This layers on top of a dedicated debugging-discipline skill (superpowers:systematic-debugging, ace:systematic-debugging) but requires none. It covers the Android-specific parts that are easy to get wrong, not standard adb / Logcat / LeakCanary usage or reading a Gradle error.
ANR traces are /data/anr/anr_* files on current releases (a single traces.txt only on old ones): adb shell ls /data/anr, then adb pull /data/anr/<filename>; without root, capture adb bugreport. For triaging the dump, use Google's anr-audit-and-fix skill (android skills add anr-audit-and-fix).
Measure before you fix. For performance regressions, logs usually mislead — capture a baseline measurement before changing anything, then bisect against it. A trace tells you where time goes; only a comparison against a known-good baseline tells you what actually regressed.
To record and query a Perfetto trace, use Google's android-profiler skill (android skills list to check for a local install; android skills add android-profiler otherwise).
Release crash stack traces are obfuscated. Decode them with the mapping file generated at build time.
# R8 retrace ships in the SDK command-line tools (cmdline-tools/<version>/bin/)
retrace mapping.txt crash.txt
Mapping files are in app/build/outputs/mapping/<variant>/mapping.txt. Always archive them alongside release builds.
If a class is unexpectedly removed or renamed, add a -keep rule in proguard-rules.pro and verify with:
./gradlew :app:assembleRelease
# Then inspect: app/build/outputs/mapping/release/usage.txt (removed) and seeds.txt (kept)
For the inverse problem — reading obfuscated third-party code or decoding a stack trace from a library where the mapping file isn't yours — retrace doesn't apply. Use jadx --deobf (consistent renames across the decompiled output) or jadx --deobf-map (when the SDK ships a mapping). The android-reverse-engineering plugin covers the full workflow including the anchor-via-strings strategy for navigating obfuscated code by string literals and framework class names that survive obfuscation (check if it's already installed locally first — it ships as android-reverse-engineering:* skills).
When a bug is visual (wrong element state, missing content, overlap), dump the layout tree directly instead of reasoning from a screenshot:
# Full layout tree as JSON — search by class/text/bounds instead of parsing an image
android layout --pretty
# Target a specific device, write to file
android layout --device=emulator-5554 -o layout.json
Prefer android layout over adb screencap whenever the question is "what is the UI state?" rather than "what does it look like?". The JSON tree is grep-able; to see what changed between two states, write each dump with -o and diff the files.
Stability, skipping and phase diagnosis live in android-skills:compose → compose/references/performance.md. Since Kotlin 2.0.20 strong skipping memoizes lambdas automatically — when a composable recomposes too often, look for a parameter that gets a new instance each time, not for a lambda to wrap in remember.
For issues spanning multiple layers (e.g. Repository → ViewModel → UI):
// Temporarily instrument each boundary with a UNIQUE run-specific tag
// (pick a fresh suffix per session, e.g. DEBUG-a4f2) so the SAME tag both
// filters logcat at runtime and greps cleanly at teardown.
class UserRepository(...) {
suspend fun fetchUser(id: String): User {
Log.d("DEBUG-a4f2", "Repository: fetching user $id")
val result = api.getUser(id)
Log.d("DEBUG-a4f2", "Repository: received ${result}")
return result
}
}
Run once to identify which layer produces the bad value. Filter the run at runtime with adb logcat -s "DEBUG-a4f2", then tear the instrumentation back out with a single grep -rl "DEBUG-a4f2". A unique per-session tag is what makes both one-liners work — a shared tag like DEBUG_LAYER collides across sessions and leaves orphaned logs behind. Then investigate the implicated layer in isolation before proposing a fix.
Remove every temporary log before declaring the fix done.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
android-debugging, anr, proguard, perfetto, stack-trace-deobfuscation
21 skills in this plugin
/android-data-layerUse when implementing the data layer in Android or KMP — the Repository pattern's layered error-propagation model (repository as the error boundary, sealed DataError, Result placement with and without a domain layer) and Room in commonMain (@ConstructedBy, BundledSQLiteDriver, per-target KSP)./android-devUse this skill as the baseline for ALL Android and Kotlin Multiplatform (KMP) work — whenever the user mentions Android, Kotlin (in an Android context), KMP, CMP, commonMain, androidMain, iosMain, AndroidManifest, Gradle, build.gradle, Hilt, Dagger, Room, Retrofit, Ktor, ViewModel, LiveData, StateFlow, SharedFlow, Compose, Activity, Fragment, Intent, ADB, Logcat, MVVM, MVI, repository pattern, or any Android SDK / Jetpack / AndroidX API. Always load this skill alongside the more specific skills (android-skills:compose, android-skills:kotlin-flows, android-skills:kmp-ktor, android-skills:android-retrofit, etc.): it routes to them and adds the few baseline rules that are easy to get wrong. Casual mentions like "fix this bug in my Android app," "refactor this ViewModel," "my KMP project," or any work inside an Android project directory should trigger this skill.
/android-gradle-logicUse when setting up or refactoring Android Gradle build logic — convention plugins, composite builds, version catalogs, and shared build configuration across modules./android-retrofitUse when setting up or working with Retrofit in Android — service interface definitions, coroutines integration, OkHttp configuration, Hilt module setup, and error handling in the repository layer./android-source-searchUse when needing to fetch Android source code — AOSP platform internals (@hide APIs, framework classes, system services) or AndroidX/Jetpack library source and samples. Also use when public docs are insufficient to complete a task and implementation details must be read directly from source./android-testingUse when writing, fixing, or refactoring Android/KMP code in Kotlin — a test-first (RED-GREEN-REFACTOR) foundation plus the Android/KMP test traps: Compose-test dispatching (v1 vs v2 test APIs, the two-schedulers trap), semantics-first selectors, choosing the smallest test shape, test-clock vs wall-clock, animation/screenshot determinism, and a `commonTest` name that fails the iOS compile while `jvmTest` stays green.
npx claudepluginhub rcosteira79/android-skills --plugin android-skillsOther plugins' skills for the same job