Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add ttdazi/AndroidAISkills --skill android-perfetto-capturegit clone --depth 1 https://github.com/ttdazi/AndroidAISkillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/ttdazi/androidaiskills/android-perfetto-capture)<a href="https://agentmods.dev/skills/ttdazi/androidaiskills/android-perfetto-capture"><img src="https://agentmods.dev/badge/skills/ttdazi/androidaiskills/android-perfetto-capture/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/ttdazi/androidaiskills/android-perfetto-capture"><img src="https://agentmods.dev/badge/skills/ttdazi/androidaiskills/android-perfetto-capture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00127 | $0.02103 |
| Opus 5 | $0.00063 | $0.01052 |
| Sonnet 5 | $0.00025 | $0.00421 |
| Haiku 4.5 | $0.00013 | $0.00210 |
Grade A, and why
android-perfetto-capture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Android:Perfetto 采集(adb 主线)
何时用本 skill
- 需要
adb shell perfetto在真机/工程机上录 系统级 Perfetto trace,并用adb pull取回。 - 需要 可版本化 的采集配置(本 skill 自带
configs/*.pbtxt),避免「设置里找不到系统跟踪」类 OEM 差异。 - ANR:出现时间不可预期,短固定
duration_ms容易录空;用configs/anr-surveillance.pbtxt+ 后台/分离式启动,复现到 ANR 后 尽快结束perfetto再adb pull(见下文「ANR 场景」)。需要 view/gfx atrace 时改用configs/anr-surveillance-graphics.pbtxt(体积更大)。 - 采集完成后要衔接 Perfetto UI 或
trace_processor+perfetto-sql做分析(SQL 细节不在本 skill 展开)。
本 skill 给出 Agent 协助时的 稳定默认路径。涉及 TraceConfig 字段、平台对 perfetto 的说明、与 adb 配套的官方表述 时,不得以未经验证的网页摘要或第三方索引代替正文:须按 android-cli-docs-skills 使用终端 android docs search(如 perfetto、system trace、TraceConfig 等关键词),对结果中的 kb://... 用 android docs fetch 拉取后再引用;未 fetch 到正文不得编造。
前置检查
adb devices为device;多设备一律-s <serial>(细则见android-adb-emulator)。- 设备 Android 10+;存在可执行的
/system/bin/perfetto(极少数裁剪 ROM 可能没有)。 - 配置为 文本 proto 时,命令必须带
--txt。
默认工作流(推荐)
- 使用本目录下的
configs/minimal.pbtxt(先打通)或configs/standard.pbtxt(通用卡顿/调度向)。 adb push配置到设备/data/local/tmp/(示例见examples.md)。- 执行:
adb shell perfetto -c /data/local/tmp/<配置名>.pbtxt --txt -o /data/local/tmp/<输出名>.perfetto-trace
进程会阻塞至配置中的duration_ms结束。 adb pull将输出拉回 PC;本地文件名建议带 时间戳 + serial。
设备路径原则:优先 /data/local/tmp/ 作为配置与输出目录;避免默认假设可写 /data/misc/perfetto-traces/(权限因 ROM 而异)。
ANR 场景(不定时长看守)
问题:minimal / standard 以固定 duration_ms 为主,适合「已知短复现窗」;ANR 往往 长时间偶发,短窗录不到、长窗阻塞终端且文件暴涨。
推荐做法:
- 使用
configs/anr-surveillance.pbtxt:主缓冲为 RING_BUFFER、duration_ms仅作上限(默认 2 小时量级,可按需改小),数据源相对standard略减(减轻长时间开销)。 - 先启动采集(非阻塞),再去做复现;一旦出现 ANR(或弹窗/卡死可判定),尽快结束 设备上的
perfetto进程,使输出文件落盘完整,然后adb pull。具体--background/nohup ... &/pidof+kill以设备perfetto --help与android-cli-docs-skills拉取的正文为准(示例见examples.md第 5 节)。团队内可统一用scripts/anr-perfetto-watch.py(Python 3) 自动监听 logcat 或手动收尾并拉取产物(见examples.md第 6.9 节)。 - 与文本证据配合:
traces.txt/ bugreport 里的 ANR 栈仍用parsing-android-anr;Perfetto trace 提供 时间线、调度与 log 侧证,两者互补。
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 11d ago First seen · 84 lines · 127 tokens per session scan A 883e29330716
android-perfetto-capture is a skill published in the GitHub repository ttdazi/AndroidAISkills (5 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 127 tokens to every session and 2,103 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
ios-fix
Autonomous iOS bug fixer. (gstack).
google-mobile-ads-validate
Validates a project's Google Mobile Ads (GMA) SDK integration for iOS, Android, or Unity projects. Use when conducting a full pre-launch audit of an app that integrates GMA SDK or when validating any individual GMA SDK integration checks, such as when validating ad unit IDs and ad formats, SKAdNetwork IDs, mediation…
competition-ios-runtime
Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for IPA runtime analysis, Frida hooks, Objective-C or Swift method tracing, Keychain inspection, SSL pinning bypass, URL scheme handling, and iOS request-signing recovery. Use when the user asks to hook an IPA, trace Objective-C or Swift…
swiftui-performance-audit
SwiftUI performance: render, scroll, CPU/memory, updates, layout, Instruments.
android-tombstone-symbolication
Symbolicate the .NET runtime frames in an Android tombstone file. Extracts BuildIds and PC offsets from the native backtrace, downloads debug symbols from the Microsoft symbol server, and runs llvm-symbolizer to produce function names with source file and line numbers. USE FOR triaging a .NET MAUI or Mono Android app…
node-connect
Diagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps. Use when QR/setup code/manual connect fails, local Wi-Fi works but VPS/tailnet does not, or errors mention pairing required, unauthorized, bootstrap token invalid or expired, gateway.bind, gateway.remote.url, Tailscale…