native-app-performance
できること
このスキルは、Apple のコマンドラインツールで Time Profiler のトレースを記録し、Instruments を開かずに、負荷の高い箇所をランク付けします。ネイティブアプリの遅い動きを追う開発者向けです。
使う場面
- ✓ネイティブの Mac や iOS のアプリが遅く、負荷の高いコードを見つけたいとき。
- ✓アプリの中ではなく、コマンドラインからプロファイルを記録したいとき。
- ✓トレースのスタックが空になり、遅い操作をもう一度取り直す必要があるとき。
スキルのリンク
https://github.com/steipete/agent-scripts/blob/main/skills/native-app-performance/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“遅い操作をしながら、アプリの90秒のパフォーマンス・トレースを記録して、負荷の高い箇所の一覧を出してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは xctrace ツールでトレースを記録し、時間のサンプルを取り出し、読み込みアドレスを探します。同梱のスクリプトで、負荷の高い関数をランク付けします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Native App Performance (CLI-only)
Goal: record Time Profiler via xctrace, extract samples, symbolicate, and propose hotspots without opening Instruments.
Quick start (CLI)
- Record Time Profiler (attach):
# Start app yourself, then attach
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --attach <pid>
- Record Time Profiler (launch):
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --launch -- /path/App.app/Contents/MacOS/App
- Extract time samples:
scripts/extract_time_samples.py --trace /tmp/App.trace --output /tmp/time-sample.xml
- Get load address for symbolication:
# While app is running
vmmap <pid> | rg -m1 "__TEXT" -n
- Symbolicate + rank hotspots:
scripts/top_hotspots.py --samples /tmp/time-sample.xml \
--binary /path/App.app/Contents/MacOS/App \
--load-address 0x100000000 --top 30
Workflow notes
- Always confirm you’re profiling the correct binary (local build vs /Applications). Prefer direct binary path for
--launch. - Ensure you trigger the slow path during capture (menu open/close, refresh, etc.).
- If stacks are empty, capture longer or avoid idle sections.
xcrun xctrace help recordandxcrun xctrace help exportshow correct flags.
Included scripts
scripts/record_time_profiler.sh: record via attach or launch.scripts/extract_time_samples.py: export time-sample XML from a trace.scripts/top_hotspots.py: symbolicate and rank top app frames.
Gotchas
- ASLR means you must use the runtime
__TEXTload address fromvmmap. - If using a new build, update the
--binarypath; symbols must match the trace. - CLI-only flow: no need to open Instruments if stacks are symbolicated via
atos.
よくある質問
Instruments を開く必要がありますか?
いいえ。スキルは Instruments を開かずに、コマンドラインからプロファイリングを行います。
トレースが間違っている可能性はありますか?
あります。間違ったコピーのアプリを計測するおそれがあるため、正確なバイナリのパスを指定するよう、スキルは警告しています。
スタックが空の場合はどうしますか?
より長く記録するか、待機中の部分を避けるよう、スキルは述べています。
詳細
作者による元の説明
Native app performance: xctrace, Time Profiler, traces, hotspots.
repo: steipete/agent-scripts
人気
- GitHubのスター
- 7.4k
- ランキング
- #13237
- ライセンス
- MIT
- 更新日
- 2026/10/30
コメント
- …
このリポジトリの他のスキル
beeper
7.4kローカルの Beeper のチャット履歴を検索して、メッセージを見つけ、あいまいなヒントがどのチャットや連絡先を指すかを特定するようエージェントを支援します。
cloudflare-registrar
7.4kCloudflare Registrar のドメインの価格と空き状況を確認し、確認の手順を経てドメインを登録または一覧表示するようエージェントを支援します。
codexbar
7.4kCodex、Claude、Kimi などの AI サービスの、残りの利用量を、上限、クレジット、リセット時刻を含めて確認するようエージェントを支援します。
create-cli
7.4k人にもスクリプトにも使いやすいように、コマンドラインツールのコマンド、フラグ、ヘルプの文章、出力、エラーを設計するようエージェントを支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。