1---2name: android-performance-observability3description: Measure startup, rendering, memory, jank, vitals, logs, and crash signals for Android apps with actionable traces.4---5# Android Performance Observability67## When To Use8- Use this skill when the request is about: android performance profiling, baseline profile or macrobenchmark, app startup issue android.9- Primary outcome: Measure startup, rendering, memory, jank, vitals, logs, and crash signals for Android apps with actionable traces.10- Read `references/patterns.md` when you need the measurement ladder for startup, jank, traces, and production signals.11- Read `references/scenarios.md` for repeatable profiling and trace-oriented entry points.12- Handoff skills when the scope expands:13- `android-compose-performance`14- `android-ci-cd-release-playstore`1516## Workflow171. Classify the symptom before choosing tools: cold start, warm start, frame/jank, scrolling, memory, ANR, crash, battery, or production vitals drift.182. Measure on release-like builds and physical devices whenever possible; avoid debugging from debug-only traces or profile-unfriendly builds.193. Pick the smallest tool that answers the question: Macrobenchmark for startup/scroll numbers, Baseline Profiles for ahead-of-time optimization, Perfetto/System Tracing for deep traces, JankStats or FrameMetrics for frame quality, and Play Vitals for field evidence.204. Change one thing at a time, then compare before and after traces or benchmark outputs instead of stacking multiple optimizations blindly.215. Hand off UI-specific rendering changes or release rollouts only after the measurement surface is stable and the bottleneck is evidenced.2223## Guardrails24- Treat benchmarks, traces, and vitals as different evidence sources with different noise profiles; do not mix them casually.25- Prefer reproducible release-build measurements over debug-build intuition.26- Tie optimizations back to user-facing metrics such as startup time, frame pacing, ANRs, or battery impact.27- Keep the profiling setup stable enough that regressions are attributable to code changes instead of device or environment churn.2829## Anti-Patterns30- Chasing micro-optimizations before identifying whether the problem is startup, rendering, I/O, or field reliability.31- Reading one noisy trace and presenting the result as settled fact.32- Measuring debug builds and assuming the same behavior in production.33- Adding Baseline Profiles or macrobenchmarks without checking whether the target path is stable enough to compare.3435## Review Focus36- Startup: cold and warm launch, expensive initialization, and Baseline Profile coverage.37- Rendering: jank, skipped frames, Compose or View invalidation churn, and long main-thread work.38- Memory and reliability: allocations, leaks, ANRs, crashes, and Play Vitals trends.39- Evidence quality: repeatable commands, release-like variants, and documented before/after comparisons.4041## Examples42### Happy path43- Scenario: Audit the repo for profiling surfaces and benchmark-related hooks before proposing a measurement plan.44- Command: `rg -n "baseline|macrobenchmark|profileable|JankStats|Trace|Perfetto" .`4546### Edge case47- Scenario: Keep startup and rendering investigations grounded in repeatable release-like builds.48- Command: `cd examples/orbittasks-compose && ./gradlew :app:assembleDebug`4950### Failure recovery51- Scenario: Keep observability requests distinct from Compose-only tuning or release automation.52- Command: `python3 scripts/eval_triggers.py --skill android-performance-observability`5354## Done Checklist55- The bottleneck is classified and tied to an evidence source that can be re-run.56- The chosen tools match the symptom instead of duplicating noisy measurements.57- Before/after comparisons are explicit for any recommended optimization.58- UI-only or release-only work is separated from measurement and tracing.5960## Official References61- [https://developer.android.com/studio/profile/overview](https://developer.android.com/studio/profile/overview)62- [https://developer.android.com/topic/performance/vitals](https://developer.android.com/topic/performance/vitals)63- [https://developer.android.com/topic/performance/benchmarking/macrobenchmark-overview](https://developer.android.com/topic/performance/benchmarking/macrobenchmark-overview)64- [https://developer.android.com/topic/performance/benchmarking/macrobenchmark-metrics](https://developer.android.com/topic/performance/benchmarking/macrobenchmark-metrics)65- [https://developer.android.com/topic/performance/baselineprofiles/overview](https://developer.android.com/topic/performance/baselineprofiles/overview)66- [https://developer.android.com/topic/performance/tracing](https://developer.android.com/topic/performance/tracing)67- [https://developer.android.com/topic/performance/rendering/jankstats](https://developer.android.com/topic/performance/rendering/jankstats)