[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CHW009MBEGQBSW2JZCG0Y4":3,"skill-same:01M7CHW009MBEGQBSW2JZCG0Y4":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7CHW009MBEGQBSW2JZCG0Y4","android-performance",null,"Gather and interpret Android performance evidence on an adb target using Simpleperf CPU profiles, Perfetto or Compose traces, gfxinfo frame data, dumpsys meminfo snapshots, Java heap dumps, and native allocation traces. Use when asked to profile an Android app flow, find CPU-heavy functions, diagnose jank, capture startup or frame timing evidence, compare before\u002Fafter performance, explain what code is taking time, or gather memory\u002Fleak profiling artifacts.","rossboyd\u002Fquickque","rossboyd","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3195729?v=4","01M7CG99NTNRFV0TWTZX9JY9CQ","rbyd","01M7CG99PH4WEP5P45VTBNPDB0",0,"MIT","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftest-android-apps\u002Fskills\u002Fandroid-performance\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: android-performance\ndescription: Gather and interpret Android performance evidence on an adb target using Simpleperf CPU profiles, Perfetto or Compose traces, gfxinfo frame data, dumpsys meminfo snapshots, Java heap dumps, and native allocation traces. Use when asked to profile an Android app flow, find CPU-heavy functions, diagnose jank, capture startup or frame timing evidence, compare before\u002Fafter performance, explain what code is taking time, or gather memory\u002Fleak profiling artifacts.\n---\n\n# Android Performance\n\nUse this skill to capture Android performance evidence for adb-installable apps. CPU sampling usually requires a debuggable or profileable build; frame stats, Perfetto, and logcat can still help when an app cannot be sampled. Compose with `..\u002Fandroid-emulator-qa\u002FSKILL.md` for device selection, build\u002Finstall\u002Flaunch, UI driving, screenshots, UI trees, and logcat capture.\n\n## Core Workflow\n\n1. Pick one focused user-visible flow.\n2. Choose the trace type that matches the question.\n3. Record the flow with clear start and stop boundaries.\n4. Pull or copy the trace produced by that run, then generate reports from that file.\n5. Interpret reports with caveats about device, build type, sample count, and profiler limits.\n\nAvoid broad \"use the app for a while\" captures. They make traces hard to attribute and usually hide the functions that matter.\n\nUse a local adb target for meaningful timing. Store outputs in a run-specific artifact folder outside the skill directory:\n\n```bash\nif [ -z \"${ARTIFACT_DIR:-}\" ]; then\n  ARTIFACT_DIR=\"$(mktemp -d \"${TMPDIR:-\u002Ftmp}\u002Fcodex-android-perf.XXXXXX\")\"\nfi\nmkdir -p \"$ARTIFACT_DIR\"\n```\n\nDo not put `ARTIFACT_DIR` under `SKILL_DIR`; the skill folder is for bundled instructions and scripts, not run artifacts.\n\n## Choosing A Trace\n\n- Use **Simpleperf** when the question is \"what functions are taking CPU time?\" or when you need a sampled profile of Kotlin, Java, native, or framework execution.\n- Use **Perfetto** when the question is frame timing, startup timeline, scheduler gaps, binder work, lock contention, main-thread stalls, Compose recomposition, or why a flow felt janky.\n- Use **gfxinfo framestats** for a quick manual frame\u002Fjank snapshot. Pair it with Perfetto when you need root cause.\n- Use **meminfo \u002F heap dumps** when the question is retained Java\u002FKotlin objects, PSS, native heap, or object counts after a focused flow.\n\n## Simpleperf CPU Profiles\n\nSimpleperf `--app` works best when the installed package is debuggable or profileable from shell. Preflight before recording:\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\n\nadb -s \"$SERIAL\" shell dumpsys package \"$PACKAGE\" | grep -Ei 'DEBUGGABLE|profileable|isProfileable' || true\n```\n\nIf the package is not debuggable\u002Fprofileable and `simpleperf record --app` fails, install a debug\u002Fprofileable build when possible. If that is not possible, use Perfetto or `gfxinfo` instead of treating missing CPU samples as evidence.\n\nStart recording in one terminal or as a long-running Codex command session:\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\nMAX_DURATION_SECONDS=60\n\nadb -s \"$SERIAL\" shell rm -f \u002Fdata\u002Flocal\u002Ftmp\u002Fperf.data\nadb -s \"$SERIAL\" logcat -c\n\nadb -s \"$SERIAL\" shell simpleperf record \\\n  --app \"$PACKAGE\" \\\n  -o \u002Fdata\u002Flocal\u002Ftmp\u002Fperf.data \\\n  -e cpu-clock -f 4000 -g \\\n  --duration \"$MAX_DURATION_SECONDS\"\n```\n\nWhile that command is running, perform exactly one focused flow with adb input, UI automation, or `android-emulator-qa`.\n\nStop Simpleperf from another command and wait for the recording command to exit:\n\n```bash\nadb -s \"$SERIAL\" shell 'pid=\"$(pidof simpleperf 2>\u002Fdev\u002Fnull || true)\"; [ -n \"$pid\" ] && kill -INT $pid'\n```\n\nIf that returns `Operation not permitted`, send Ctrl-C to the original `adb shell simpleperf record` command session and wait for it to exit.\n\nPull and report the capture:\n\n```bash\nadb -s \"$SERIAL\" pull \u002Fdata\u002Flocal\u002Ftmp\u002Fperf.data \"$ARTIFACT_DIR\u002Fperf.data\"\nadb -s \"$SERIAL\" logcat -d > \"$ARTIFACT_DIR\u002Flogcat.txt\"\n\nSKILL_DIR=\"\u003Cabsolute path to this loaded skill folder>\"\nFIRST_PARTY_REGEX=\"$(printf '%s' \"$PACKAGE\" | sed 's\u002F\\.\u002F\\\\.\u002Fg')\"\n\"$SKILL_DIR\u002Fscripts\u002Fsimpleperf_hotspots.sh\" \\\n  \"$ARTIFACT_DIR\u002Fperf.data\" \\\n  \"$ARTIFACT_DIR\" \\\n  --serial \"$SERIAL\" \\\n  --first-party-regex \"$FIRST_PARTY_REGEX\"\n```\n\nDo not derive `SKILL_DIR` from the target app repo's `pwd`; installed plugins usually live outside the app being profiled. Keep `FIRST_PARTY_REGEX` scoped to the app's package or app-owned module prefixes; avoid broad framework patterns such as `kotlin`, `Compose`, or `androidx.compose` when reporting app-owned rows.\n\nThe helper writes:\n\n- `$ARTIFACT_DIR\u002Fsimpleperf-self.txt`\n- `$ARTIFACT_DIR\u002Fsimpleperf-children.txt`\n- `$ARTIFACT_DIR\u002Fsimpleperf.csv` when supported by the installed Simpleperf\n\nIf host Simpleperf is not installed, the helper searches Android Studio and Android SDK\u002FNDK locations. If unavailable, it falls back to device-side `adb shell simpleperf report` when the device still has `\u002Fdata\u002Flocal\u002Ftmp\u002Fperf.data`.\n\n## Reading Simpleperf\n\nSimpleperf reports sampled CPU execution. It does not directly measure suspended coroutines, network latency, lock wait time, or other wall-clock waits. If a flow feels slow but Simpleperf shows little app CPU, capture Perfetto to inspect scheduler gaps, binder work, locks, frame timing, and app trace sections.\n\nRead reports this way:\n\n- **Self\u002FOverhead**: samples where the function itself was executing. Use this for hot leaf work such as parsing, formatting, diffing, sorting, allocation-heavy iteration, or JSON\u002Fprotobuf processing.\n- **Children\u002Finclusive**: samples in the function and its callees. Use this for expensive entry points such as repositories, use cases, view models, Composables, startup initializers, or feature coordinators.\n- **Shared Object \u002F Symbol**: prefer app-owned package frames, feature modules, domain\u002Fdata\u002FUI modules, and generated app code. Treat Android framework, Kotlin runtime, Compose, and native\u002Fruntime frames as context unless the app-owned caller is visible.\n- **Percentages**: useful for ranking functions inside one capture. For user-facing timing claims, pair with Perfetto, `gfxinfo`, or repeated wall-clock measurements.\n\nWhen interpreting a hotspot, note symbol\u002Ffunction name, self or inclusive percentage, approximate sampled CPU time when available, caller stack or owning source file, flow steps, artifact paths, and whether the capture is single-run or repeated.\n\n## Perfetto \u002F Compose Trace\n\nIf the app repo already documents a Perfetto\u002FSystem Trace command for that project, use it. Otherwise use Perfetto directly. The light command below captures scheduler\u002Ffrequency\u002FAndroid atrace categories and app `Trace` sections for `PACKAGE`; it is not a substitute for a full project-specific Perfetto config when you need detailed frame timeline or Compose runtime internals.\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\nTRACE_DURATION_SECONDS=30\nTRACE_BASENAME=\"app-flow-$(date +%Y%m%d-%H%M%S).pftrace\"\nTRACE_DEVICE=\"\u002Fdata\u002Fmisc\u002Fperfetto-traces\u002F$TRACE_BASENAME\"\n\nPERFETTO_PID=\"$(adb -s \"$SERIAL\" shell perfetto \\\n  --background-wait \\\n  -o \"$TRACE_DEVICE\" \\\n  -t \"${TRACE_DURATION_SECONDS}s\" \\\n  --app \"$PACKAGE\" \\\n  sched freq idle am wm gfx view binder_driver hal dalvik | tr -d '\\r' | tail -n 1)\"\nprintf 'Perfetto PID: %s\\n' \"$PERFETTO_PID\"\n```\n\nRun exactly one focused flow before `TRACE_DURATION_SECONDS` expires. To stop early, gracefully terminate the background Perfetto process and give it a moment to flush:\n\n```bash\nadb -s \"$SERIAL\" shell kill -TERM \"$PERFETTO_PID\" 2>\u002Fdev\u002Fnull || true\nadb -s \"$SERIAL\" shell \"\n  last_size=-1\n  stable_count=0\n  i=0\n  while [ \\$i -lt 30 ]; do\n    size=\\$(ls -l '$TRACE_DEVICE' 2>\u002Fdev\u002Fnull | awk '{ print \\$5 }')\n    if [ -n \\\"\\$size\\\" ] && [ \\\"\\$size\\\" -gt 0 ] && [ \\\"\\$size\\\" = \\\"\\$last_size\\\" ]; then\n      stable_count=\\$((stable_count + 1))\n      [ \\$stable_count -ge 2 ] && exit 0\n    else\n      stable_count=0\n    fi\n    last_size=\\\"\\${size:-0}\\\"\n    i=\\$((i + 1))\n    sleep 1\n  done\n  exit 1\n\"\n```\n\nPrefer letting `TRACE_DURATION_SECONDS` expire instead of stopping early. If the stop command fails because the trace already ended, still wait until the output file exists and its size is stable before pulling. If the direct command is too coarse, use Android Studio System Trace or a project-specific Perfetto config. Only report frame timeline or Compose recomposition details when those tracks\u002Fevents are actually present in the captured trace; the light command above does not guarantee them.\n\nPull the exact on-device trace from this run:\n\n```bash\nadb -s \"$SERIAL\" pull \"$TRACE_DEVICE\" \"$ARTIFACT_DIR\u002F$TRACE_BASENAME\"\n```\n\nIn Perfetto, inspect:\n\n- main-thread slices around missed frames or long startup sections\n- frame scheduling, frame timeline, and render thread lanes\n- Compose runtime tracing sections for recomposition work when enabled\n- binder transactions, monitor contention, scheduler gaps, and app log markers\n\n## gfxinfo Framestats\n\nUse this for a quick manual frame snapshot:\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\n\nadb -s \"$SERIAL\" shell pidof \"$PACKAGE\"\nadb -s \"$SERIAL\" shell dumpsys window | grep -F \"$PACKAGE\"\nadb -s \"$SERIAL\" shell dumpsys gfxinfo \"$PACKAGE\" reset\n# Perform the focused flow.\nadb -s \"$SERIAL\" shell dumpsys gfxinfo \"$PACKAGE\" > \"$ARTIFACT_DIR\u002Fgfxinfo.txt\"\nadb -s \"$SERIAL\" shell dumpsys gfxinfo \"$PACKAGE\" framestats > \"$ARTIFACT_DIR\u002Fgfxinfo-framestats.txt\"\n```\n\nCapture from a stable, responsive screen. If `dumpsys gfxinfo` fails to dump the process, or the device shows an ANR\u002Fdialog\u002Fsplash screen instead of the flow, discard that capture and use Perfetto for root cause.\n\nRead the headline summary first: total frames, janky frames, frame percentiles, slow UI thread, slow draw commands, and frame deadline misses. On emulators, absolute smoothness numbers are noisy; percentile spikes and slow draw\u002FUI counters are still useful for deciding whether to take a Perfetto trace.\n\n## Memory \u002F Leak Artifacts\n\nUse this on an adb target after narrowing the investigation to one flow. Exercise the flow, return to a stable screen, then capture memory artifacts from that state.\n\nFor quick Java\u002Fnative\u002FPSS\u002Fobject-count snapshots:\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\n\nadb -s \"$SERIAL\" shell am force-stop \"$PACKAGE\"\nadb -s \"$SERIAL\" shell monkey -p \"$PACKAGE\" 1\n# Exercise the focused flow, then navigate back to a stable idle screen.\nadb -s \"$SERIAL\" shell dumpsys meminfo \"$PACKAGE\" > \"$ARTIFACT_DIR\u002Fmeminfo-flow.txt\"\n```\n\nRead `TOTAL PSS`, Java heap, native heap, graphics, `Views`, `Activities`, binder counts, and object counts. Treat one noisy sample as a lead, not a conclusion.\n\nFor retained Kotlin\u002FJava objects, prefer Shark CLI when it is available. It works with Android heap dumps and produces text output the agent can inspect and cite.\n\n```bash\nHEAP=\"\u002Fdata\u002Flocal\u002Ftmp\u002Fapp-flow.hprof\"\nHPROF=\"$ARTIFACT_DIR\u002Fapp-flow.hprof\"\n\nif ! command -v shark-cli >\u002Fdev\u002Fnull; then\n  echo \"Install Shark CLI, or analyze the HPROF with Android Studio Profiler \u002F MAT.\" >&2\nfi\n\nadb -s \"$SERIAL\" shell am dumpheap -g \"$PACKAGE\" \"$HEAP\"\nadb -s \"$SERIAL\" pull \"$HEAP\" \"$HPROF\"\nadb -s \"$SERIAL\" shell rm -f \"$HEAP\"\n\nif command -v shark-cli >\u002Fdev\u002Fnull; then\n  shark-cli --hprof \"$HPROF\" analyze | tee \"$ARTIFACT_DIR\u002Fshark-analysis.txt\"\nfi\n```\n\nRead `shark-analysis.txt` first when it exists. Report suspected leaking objects, retained sizes, and reference chains. Look for retained feature objects, activities, fragments, view models, Compose state holders, repositories, listeners, callbacks, and caches that should have been released after leaving the flow. If Shark CLI is unavailable, still preserve the HPROF path and inspect it with the best available heap analyzer; do not claim leak roots from `meminfo` alone.\n\nFor native allocation growth, capture a Perfetto trace with heapprofd enabled. Keep the duration in the config; current Android `perfetto` rejects `-t` together with `--config`.\n\n```bash\nTRACE_DEVICE=\"\u002Fdata\u002Fmisc\u002Fperfetto-traces\u002Fnative-alloc.pftrace\"\n\nadb -s \"$SERIAL\" shell perfetto -o \"$TRACE_DEVICE\" \\\n  --txt -c - \u003C\u003CEOF\nduration_ms: 60000\nbuffers { size_kb: 262144 fill_policy: RING_BUFFER }\ndata_sources {\n  config {\n    name: \"android.heapprofd\"\n    heapprofd_config {\n      sampling_interval_bytes: 65536\n      shmem_size_bytes: 8388608\n      block_client: true\n      process_cmdline: \"$PACKAGE\"\n    }\n  }\n}\nEOF\n\nadb -s \"$SERIAL\" pull \"$TRACE_DEVICE\" \"$ARTIFACT_DIR\u002Fnative-alloc.pftrace\"\n```\n\nAnalyze the trace with `trace_processor_shell` and save the outputs:\n\n```bash\nSKILL_DIR=\"\u003Cabsolute path to this loaded skill folder>\"\n\"$SKILL_DIR\u002Fscripts\u002Fheapprofd_reports.sh\" \\\n  \"$ARTIFACT_DIR\u002Fnative-alloc.pftrace\" \\\n  \"$ARTIFACT_DIR\"\n```\n\nRead `heapprofd-summary.txt`, `heapprofd-top-allocations.txt`, `heapprofd-top-stack.txt`, `heapprofd-health.txt`, and `meminfo` together. Report net native allocation size, top allocating frames\u002Fmappings, the expanded stack for the largest callsite, and whether trace stats show heapprofd health issues such as client errors, packet loss, or buffer overruns. Prefer Java heap dumps for retained app objects; heapprofd is for native allocation behavior.\n\n## Report\n\nReport:\n\n- exact flow, device\u002Femulator, Android version, build variant, and run count\n- artifact paths for every trace\u002Freport used\n- top hotspots or frame\u002Fjank evidence with percentages, durations, or counts\n- whether evidence is CPU samples, frame timeline, frame stats, or memory artifacts\n- caveats such as emulator noise, low sample count, cold-start compilation, or missing symbols\n- next smallest trace or code change when current evidence is insufficient\n","# Android Performance\n\nUse this skill to capture Android performance evidence for adb-installable apps. CPU sampling usually requires a debuggable or profileable build; frame stats, Perfetto, and logcat can still help when an app cannot be sampled. Compose with `..\u002Fandroid-emulator-qa\u002FSKILL.md` for device selection, build\u002Finstall\u002Flaunch, UI driving, screenshots, UI trees, and logcat capture.\n\n## Core Workflow\n\n1. Pick one focused user-visible flow.\n2. Choose the trace type that matches the question.\n3. Record the flow with clear start and stop boundaries.\n4. Pull or copy the trace produced by that run, then generate reports from that file.\n5. Interpret reports with caveats about device, build type, sample count, and profiler limits.\n\nAvoid broad \"use the app for a while\" captures. They make traces hard to attribute and usually hide the functions that matter.\n\nUse a local adb target for meaningful timing. Store outputs in a run-specific artifact folder outside the skill directory:\n\n```bash\nif [ -z \"${ARTIFACT_DIR:-}\" ]; then\n  ARTIFACT_DIR=\"$(mktemp -d \"${TMPDIR:-\u002Ftmp}\u002Fcodex-android-perf.XXXXXX\")\"\nfi\nmkdir -p \"$ARTIFACT_DIR\"\n```\n\nDo not put `ARTIFACT_DIR` under `SKILL_DIR`; the skill folder is for bundled instructions and scripts, not run artifacts.\n\n## Choosing A Trace\n\n- Use **Simpleperf** when the question is \"what functions are taking CPU time?\" or when you need a sampled profile of Kotlin, Java, native, or framework execution.\n- Use **Perfetto** when the question is frame timing, startup timeline, scheduler gaps, binder work, lock contention, main-thread stalls, Compose recomposition, or why a flow felt janky.\n- Use **gfxinfo framestats** for a quick manual frame\u002Fjank snapshot. Pair it with Perfetto when you need root cause.\n- Use **meminfo \u002F heap dumps** when the question is retained Java\u002FKotlin objects, PSS, native heap, or object counts after a focused flow.\n\n## Simpleperf CPU Profiles\n\nSimpleperf `--app` works best when the installed package is debuggable or profileable from shell. Preflight before recording:\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\n\nadb -s \"$SERIAL\" shell dumpsys package \"$PACKAGE\" | grep -Ei 'DEBUGGABLE|profileable|isProfileable' || true\n```\n\nIf the package is not debuggable\u002Fprofileable and `simpleperf record --app` fails, install a debug\u002Fprofileable build when possible. If that is not possible, use Perfetto or `gfxinfo` instead of treating missing CPU samples as evidence.\n\nStart recording in one terminal or as a long-running Codex command session:\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\nMAX_DURATION_SECONDS=60\n\nadb -s \"$SERIAL\" shell rm -f \u002Fdata\u002Flocal\u002Ftmp\u002Fperf.data\nadb -s \"$SERIAL\" logcat -c\n\nadb -s \"$SERIAL\" shell simpleperf record \\\n  --app \"$PACKAGE\" \\\n  -o \u002Fdata\u002Flocal\u002Ftmp\u002Fperf.data \\\n  -e cpu-clock -f 4000 -g \\\n  --duration \"$MAX_DURATION_SECONDS\"\n```\n\nWhile that command is running, perform exactly one focused flow with adb input, UI automation, or `android-emulator-qa`.\n\nStop Simpleperf from another command and wait for the recording command to exit:\n\n```bash\nadb -s \"$SERIAL\" shell 'pid=\"$(pidof simpleperf 2>\u002Fdev\u002Fnull || true)\"; [ -n \"$pid\" ] && kill -INT $pid'\n```\n\nIf that returns `Operation not permitted`, send Ctrl-C to the original `adb shell simpleperf record` command session and wait for it to exit.\n\nPull and report the capture:\n\n```bash\nadb -s \"$SERIAL\" pull \u002Fdata\u002Flocal\u002Ftmp\u002Fperf.data \"$ARTIFACT_DIR\u002Fperf.data\"\nadb -s \"$SERIAL\" logcat -d > \"$ARTIFACT_DIR\u002Flogcat.txt\"\n\nSKILL_DIR=\"\u003Cabsolute path to this loaded skill folder>\"\nFIRST_PARTY_REGEX=\"$(printf '%s' \"$PACKAGE\" | sed 's\u002F\\.\u002F\\\\.\u002Fg')\"\n\"$SKILL_DIR\u002Fscripts\u002Fsimpleperf_hotspots.sh\" \\\n  \"$ARTIFACT_DIR\u002Fperf.data\" \\\n  \"$ARTIFACT_DIR\" \\\n  --serial \"$SERIAL\" \\\n  --first-party-regex \"$FIRST_PARTY_REGEX\"\n```\n\nDo not derive `SKILL_DIR` from the target app repo's `pwd`; installed plugins usually live outside the app being profiled. Keep `FIRST_PARTY_REGEX` scoped to the app's package or app-owned module prefixes; avoid broad framework patterns such as `kotlin`, `Compose`, or `androidx.compose` when reporting app-owned rows.\n\nThe helper writes:\n\n- `$ARTIFACT_DIR\u002Fsimpleperf-self.txt`\n- `$ARTIFACT_DIR\u002Fsimpleperf-children.txt`\n- `$ARTIFACT_DIR\u002Fsimpleperf.csv` when supported by the installed Simpleperf\n\nIf host Simpleperf is not installed, the helper searches Android Studio and Android SDK\u002FNDK locations. If unavailable, it falls back to device-side `adb shell simpleperf report` when the device still has `\u002Fdata\u002Flocal\u002Ftmp\u002Fperf.data`.\n\n## Reading Simpleperf\n\nSimpleperf reports sampled CPU execution. It does not directly measure suspended coroutines, network latency, lock wait time, or other wall-clock waits. If a flow feels slow but Simpleperf shows little app CPU, capture Perfetto to inspect scheduler gaps, binder work, locks, frame timing, and app trace sections.\n\nRead reports this way:\n\n- **Self\u002FOverhead**: samples where the function itself was executing. Use this for hot leaf work such as parsing, formatting, diffing, sorting, allocation-heavy iteration, or JSON\u002Fprotobuf processing.\n- **Children\u002Finclusive**: samples in the function and its callees. Use this for expensive entry points such as repositories, use cases, view models, Composables, startup initializers, or feature coordinators.\n- **Shared Object \u002F Symbol**: prefer app-owned package frames, feature modules, domain\u002Fdata\u002FUI modules, and generated app code. Treat Android framework, Kotlin runtime, Compose, and native\u002Fruntime frames as context unless the app-owned caller is visible.\n- **Percentages**: useful for ranking functions inside one capture. For user-facing timing claims, pair with Perfetto, `gfxinfo`, or repeated wall-clock measurements.\n\nWhen interpreting a hotspot, note symbol\u002Ffunction name, self or inclusive percentage, approximate sampled CPU time when available, caller stack or owning source file, flow steps, artifact paths, and whether the capture is single-run or repeated.\n\n## Perfetto \u002F Compose Trace\n\nIf the app repo already documents a Perfetto\u002FSystem Trace command for that project, use it. Otherwise use Perfetto directly. The light command below captures scheduler\u002Ffrequency\u002FAndroid atrace categories and app `Trace` sections for `PACKAGE`; it is not a substitute for a full project-specific Perfetto config when you need detailed frame timeline or Compose runtime internals.\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\nTRACE_DURATION_SECONDS=30\nTRACE_BASENAME=\"app-flow-$(date +%Y%m%d-%H%M%S).pftrace\"\nTRACE_DEVICE=\"\u002Fdata\u002Fmisc\u002Fperfetto-traces\u002F$TRACE_BASENAME\"\n\nPERFETTO_PID=\"$(adb -s \"$SERIAL\" shell perfetto \\\n  --background-wait \\\n  -o \"$TRACE_DEVICE\" \\\n  -t \"${TRACE_DURATION_SECONDS}s\" \\\n  --app \"$PACKAGE\" \\\n  sched freq idle am wm gfx view binder_driver hal dalvik | tr -d '\\r' | tail -n 1)\"\nprintf 'Perfetto PID: %s\\n' \"$PERFETTO_PID\"\n```\n\nRun exactly one focused flow before `TRACE_DURATION_SECONDS` expires. To stop early, gracefully terminate the background Perfetto process and give it a moment to flush:\n\n```bash\nadb -s \"$SERIAL\" shell kill -TERM \"$PERFETTO_PID\" 2>\u002Fdev\u002Fnull || true\nadb -s \"$SERIAL\" shell \"\n  last_size=-1\n  stable_count=0\n  i=0\n  while [ \\$i -lt 30 ]; do\n    size=\\$(ls -l '$TRACE_DEVICE' 2>\u002Fdev\u002Fnull | awk '{ print \\$5 }')\n    if [ -n \\\"\\$size\\\" ] && [ \\\"\\$size\\\" -gt 0 ] && [ \\\"\\$size\\\" = \\\"\\$last_size\\\" ]; then\n      stable_count=\\$((stable_count + 1))\n      [ \\$stable_count -ge 2 ] && exit 0\n    else\n      stable_count=0\n    fi\n    last_size=\\\"\\${size:-0}\\\"\n    i=\\$((i + 1))\n    sleep 1\n  done\n  exit 1\n\"\n```\n\nPrefer letting `TRACE_DURATION_SECONDS` expire instead of stopping early. If the stop command fails because the trace already ended, still wait until the output file exists and its size is stable before pulling. If the direct command is too coarse, use Android Studio System Trace or a project-specific Perfetto config. Only report frame timeline or Compose recomposition details when those tracks\u002Fevents are actually present in the captured trace; the light command above does not guarantee them.\n\nPull the exact on-device trace from this run:\n\n```bash\nadb -s \"$SERIAL\" pull \"$TRACE_DEVICE\" \"$ARTIFACT_DIR\u002F$TRACE_BASENAME\"\n```\n\nIn Perfetto, inspect:\n\n- main-thread slices around missed frames or long startup sections\n- frame scheduling, frame timeline, and render thread lanes\n- Compose runtime tracing sections for recomposition work when enabled\n- binder transactions, monitor contention, scheduler gaps, and app log markers\n\n## gfxinfo Framestats\n\nUse this for a quick manual frame snapshot:\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\n\nadb -s \"$SERIAL\" shell pidof \"$PACKAGE\"\nadb -s \"$SERIAL\" shell dumpsys window | grep -F \"$PACKAGE\"\nadb -s \"$SERIAL\" shell dumpsys gfxinfo \"$PACKAGE\" reset\n# Perform the focused flow.\nadb -s \"$SERIAL\" shell dumpsys gfxinfo \"$PACKAGE\" > \"$ARTIFACT_DIR\u002Fgfxinfo.txt\"\nadb -s \"$SERIAL\" shell dumpsys gfxinfo \"$PACKAGE\" framestats > \"$ARTIFACT_DIR\u002Fgfxinfo-framestats.txt\"\n```\n\nCapture from a stable, responsive screen. If `dumpsys gfxinfo` fails to dump the process, or the device shows an ANR\u002Fdialog\u002Fsplash screen instead of the flow, discard that capture and use Perfetto for root cause.\n\nRead the headline summary first: total frames, janky frames, frame percentiles, slow UI thread, slow draw commands, and frame deadline misses. On emulators, absolute smoothness numbers are noisy; percentile spikes and slow draw\u002FUI counters are still useful for deciding whether to take a Perfetto trace.\n\n## Memory \u002F Leak Artifacts\n\nUse this on an adb target after narrowing the investigation to one flow. Exercise the flow, return to a stable screen, then capture memory artifacts from that state.\n\nFor quick Java\u002Fnative\u002FPSS\u002Fobject-count snapshots:\n\n```bash\nSERIAL=\"\u003Cadb-serial>\"\nPACKAGE=\"\u003Capp package>\"\n\nadb -s \"$SERIAL\" shell am force-stop \"$PACKAGE\"\nadb -s \"$SERIAL\" shell monkey -p \"$PACKAGE\" 1\n# Exercise the focused flow, then navigate back to a stable idle screen.\nadb -s \"$SERIAL\" shell dumpsys meminfo \"$PACKAGE\" > \"$ARTIFACT_DIR\u002Fmeminfo-flow.txt\"\n```\n\nRead `TOTAL PSS`, Java heap, native heap, graphics, `Views`, `Activities`, binder counts, and object counts. Treat one noisy sample as a lead, not a conclusion.\n\nFor retained Kotlin\u002FJava objects, prefer Shark CLI when it is available. It works with Android heap dumps and produces text output the agent can inspect and cite.\n\n```bash\nHEAP=\"\u002Fdata\u002Flocal\u002Ftmp\u002Fapp-flow.hprof\"\nHPROF=\"$ARTIFACT_DIR\u002Fapp-flow.hprof\"\n\nif ! command -v shark-cli >\u002Fdev\u002Fnull; then\n  echo \"Install Shark CLI, or analyze the HPROF with Android Studio Profiler \u002F MAT.\" >&2\nfi\n\nadb -s \"$SERIAL\" shell am dumpheap -g \"$PACKAGE\" \"$HEAP\"\nadb -s \"$SERIAL\" pull \"$HEAP\" \"$HPROF\"\nadb -s \"$SERIAL\" shell rm -f \"$HEAP\"\n\nif command -v shark-cli >\u002Fdev\u002Fnull; then\n  shark-cli --hprof \"$HPROF\" analyze | tee \"$ARTIFACT_DIR\u002Fshark-analysis.txt\"\nfi\n```\n\nRead `shark-analysis.txt` first when it exists. Report suspected leaking objects, retained sizes, and reference chains. Look for retained feature objects, activities, fragments, view models, Compose state holders, repositories, listeners, callbacks, and caches that should have been released after leaving the flow. If Shark CLI is unavailable, still preserve the HPROF path and inspect it with the best available heap analyzer; do not claim leak roots from `meminfo` alone.\n\nFor native allocation growth, capture a Perfetto trace with heapprofd enabled. Keep the duration in the config; current Android `perfetto` rejects `-t` together with `--config`.\n\n```bash\nTRACE_DEVICE=\"\u002Fdata\u002Fmisc\u002Fperfetto-traces\u002Fnative-alloc.pftrace\"\n\nadb -s \"$SERIAL\" shell perfetto -o \"$TRACE_DEVICE\" \\\n  --txt -c - \u003C\u003CEOF\nduration_ms: 60000\nbuffers { size_kb: 262144 fill_policy: RING_BUFFER }\ndata_sources {\n  config {\n    name: \"android.heapprofd\"\n    heapprofd_config {\n      sampling_interval_bytes: 65536\n      shmem_size_bytes: 8388608\n      block_client: true\n      process_cmdline: \"$PACKAGE\"\n    }\n  }\n}\nEOF\n\nadb -s \"$SERIAL\" pull \"$TRACE_DEVICE\" \"$ARTIFACT_DIR\u002Fnative-alloc.pftrace\"\n```\n\nAnalyze the trace with `trace_processor_shell` and save the outputs:\n\n```bash\nSKILL_DIR=\"\u003Cabsolute path to this loaded skill folder>\"\n\"$SKILL_DIR\u002Fscripts\u002Fheapprofd_reports.sh\" \\\n  \"$ARTIFACT_DIR\u002Fnative-alloc.pftrace\" \\\n  \"$ARTIFACT_DIR\"\n```\n\nRead `heapprofd-summary.txt`, `heapprofd-top-allocations.txt`, `heapprofd-top-stack.txt`, `heapprofd-health.txt`, and `meminfo` together. Report net native allocation size, top allocating frames\u002Fmappings, the expanded stack for the largest callsite, and whether trace stats show heapprofd health issues such as client errors, packet loss, or buffer overruns. Prefer Java heap dumps for retained app objects; heapprofd is for native allocation behavior.\n\n## Report\n\nReport:\n\n- exact flow, device\u002Femulator, Android version, build variant, and run count\n- artifact paths for every trace\u002Freport used\n- top hotspots or frame\u002Fjank evidence with percentages, durations, or counts\n- whether evidence is CPU samples, frame timeline, frame stats, or memory artifacts\n- caveats such as emulator noise, low sample count, cold-start compilation, or missing symbols\n- next smallest trace or code change when current evidence is insufficient\n",{"name":5,"description":7},"main","907b1d897cc6743f7f133f8ea2021e1331b0b020",".codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftest-android-apps\u002Fskills\u002Fandroid-performance","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque","https:\u002F\u002Fgithub.com\u002Frossboyd","www.bigideasgroup.co.uk","2026-09-22 02:03:50",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add rossboyd\u002Fquickque --skill android-performance",{"tool":37,"command":38},"bunx","bunx skills add rossboyd\u002Fquickque --skill android-performance",{"tool":40,"command":41},"pnpm","pnpm dlx skills add rossboyd\u002Fquickque --skill android-performance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftest-android-apps\u002Fskills\u002Fandroid-performance\u002FSKILL.md",true,[45,51,57],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",263,"https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftest-android-apps\u002Fskills\u002Fandroid-performance\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"scripts\u002Fheapprofd_reports.sh","SCRIPT","脚本",3730,"https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftest-android-apps\u002Fskills\u002Fandroid-performance\u002Fscripts\u002Fheapprofd_reports.sh",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"scripts\u002Fsimpleperf_hotspots.sh",7259,"https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002F.tmp\u002Fplugins\u002Fplugins\u002Ftest-android-apps\u002Fskills\u002Fandroid-performance\u002Fscripts\u002Fsimpleperf_hotspots.sh",[62,71,79,86,93,101],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":66,"licenseFileUrl":67,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":19},"01M7CJSS21K09H3ZQZMPFR4ZAG","skill-installer","Install Codex skills into $CODEX_HOME\u002Fskills from a curated list or a GitHub repo path. Use when a user asks to list installable skills, install a curated skill, or install a skill from another repo (including private repos).","Apache-2.0","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fskill-installer\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fskill-installer\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":66,"licenseFileUrl":75,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CJSM1F4E7RBXCS3C18EFBY","skill-creator","Create or update a Codex skill with appropriately scoped instructions and any needed supporting resources.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fskill-creator\u002Flicense.txt","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fskill-creator\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CJSGF2PJM504Q6TZCNT27C","review-agent","Perform a read-only, defect-first review of a specified code change and return every actionable finding. Use when another agent delegates review of uncommitted changes, a base-branch diff, a commit, or custom review instructions.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Freview-agent\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CJSBQTPFEQYZF4VWS7QZ3N","plugin-creator","Create and scaffold plugin directories for Codex with a required `.codex-plugin\u002Fplugin.json`, optional plugin folders\u002Ffiles, valid manifest defaults, and personal-marketplace entries by default. Use when Codex needs to create a new personal plugin, add optional plugin structure, generate or update marketplace entries for plugin ordering and availability metadata, or update an existing local plugin during development with the CLI-driven cachebuster and reinstall flow.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fplugin-creator\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":66,"licenseFileUrl":97,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7CJS5BHJZKA16353PVZGC50","openai-docs","Use for Codex models\u002Fpricing, scheduled tasks, skills, settings, setup, troubleshooting, customization, automations, and self-knowledge—including 'you,' 'your,' 'this app,' or 'this coding agent' when they refer to Codex—and for OpenAI APIs\u002Fproducts and ChatGPT Work. Also use for model choice\u002Fmigration, prompting, SDKs, Responses, Realtime, agents, evals, and Chat\u002FWork\u002FCodex comparisons. Do not use for generic app\u002Fsoftware tasks that merely mention Codex.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fopenai-docs\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fopenai-docs\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":66,"licenseFileUrl":105,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M7CJRY1FC048P3RF4YQZ6J8B","imagegen","Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output should be a bitmap asset rather than repo-native code or vector. Do not use when the task is better handled by editing existing SVG\u002Fvector\u002Fcode-native assets, extending an established icon or logo system, or building the visual directly in HTML\u002FCSS\u002Fcanvas.","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fimagegen\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Frossboyd\u002Fquickque\u002Fblob\u002Fmain\u002F.codex\u002Fskills\u002F.system\u002Fimagegen\u002FSKILL.md",[],[]]