Peter Steinberger

Instruments Profiling

開発v1.0.0
作者:Peter Steinberger更新日 2026-05-11instruments-profiling@clawhub_steipete/instruments-profiling
バグ修正

AlphaMoatによると、2026-09時点でInstruments Profilingのダウンロード数は3,345、スター数は3で、AIスキル全体5,078件中3,377位、開発では577件中430位です。

インストール数
118
ダウンロード数
3345
スター数
3
総合順位
#3,377
全体の上位 67% · 開発の上位 75%
プラットフォームインストール数ダウンロード数スター数コメント
ClawHub ↗10733453-
SkillHub ↗11833093—

プラットフォームごとに集計方法と集計時点が異なります。

このスキルでできること

正しいバイナリの選択、CLI による Time Profiler 記録、結果の出力、一般的な問題を扱います。記録時にアプリを起動したり実行中プロセスへ接続したりする場合があるため、対象と出力先を先に確認してください。

資料公開日 2026-10-29

できること

  • macOS/iOS ネイティブアプリの性能問題を調査する
  • Time Profiler のトレースを取得・確認する

使う場面

  • ネイティブアプリの性能やスタックを分析するとき

プロンプト例

スキルのドキュメントをもとに生成した例であり、実際の実行結果ではありません。

対象アプリのプロセス選択方法とプロファイリング計画を説明してください。アプリ起動やトレース記録はしないでください。

月次の推移

ダウンロード数3345
2161279734332026-03 · ダウンロード数 22492026-05 · ダウンロード数 26942026-06 · ダウンロード数 28372026-07 · ダウンロード数 30922026-08 · ダウンロード数 32202026-09 · ダウンロード数 334526-0326-09
スター数3
2342026-03 · スター数 32026-05 · スター数 32026-06 · スター数 32026-07 · スター数 32026-08 · スター数 32026-09 · スター数 326-0326-09

2026-09 から集計方法を変更し、同名スキルを作者ごとに分けて集計し、全スキルを対象にしました。破線は変更前の月で、変更後のデータとは直接比較せず、変更をまたぐ増減も計算していません。

月ダウンロード数前月比スター数
2026-093345—3
2026-083220+4.1%3
2026-073092+9.0%3
2026-062837+5.3%3
2026-052694—3
2026-032249—3

SKILL.md 原文

作者が公開した元のファイルをテキストのまま表示しています。AlphaMoat による編集や審査はしていません。リンクはクリックできません。コマンドは内容を確認してから実行してください。取得日 2026-10-23。

3.7 KB・ClawHub v1.0.0
---
name: instruments-profiling
description: Use when profiling native macOS or iOS apps with Instruments/xctrace. Covers correct binary selection, CLI arguments, exports, and common gotchas.
metadata:
  short-description: Instruments profiling for macOS/iOS apps
---

# Instruments Profiling (macOS/iOS)

Use this skill when the user wants performance profiling or stack analysis for native apps.
すべて表示(全 90 行)
Focus: Time Profiler, `xctrace` CLI, and picking the correct binary/app instance.

## Quick Start (CLI)

- List templates: `xcrun xctrace list templates`
- Record Time Profiler (launch):
  - `xcrun xctrace record --template 'Time Profiler' --time-limit 60s --output /tmp/App.trace --launch -- /path/To/App.app`
- Record Time Profiler (attach):
  - Launch app yourself, get PID, then:
  - `xcrun xctrace record --template 'Time Profiler' --time-limit 60s --output /tmp/App.trace --attach <pid>`
- Open trace in Instruments:
  - `open -a Instruments /tmp/App.trace`

Note: `xcrun xctrace --help` is not a valid subcommand. Use `xcrun xctrace help record`.

## Picking the Correct Binary (Critical)

**Gotcha: Instruments may profile the wrong app** (e.g., one in `/Applications`) if LaunchServices resolves a different bundle.
Use these rules:

- Prefer direct binary path for deterministic launch:
  - `xcrun xctrace record ... --launch -- /path/App.app/Contents/MacOS/App`
- If launching `.app`, ensure it’s the intended bundle:
  - `open -n /path/App.app`
  - Verify with `ps -p <pid> -o comm= -o command=`
- If both `/Applications/App.app` and a local build exist, explicitly target the local build path.
- After launch, confirm the process path before trusting the trace.

## Command Arguments (xctrace)

- `--template 'Time Profiler'`: template name from `xctrace list templates`.
- `--launch -- <cmd>`: everything after `--` is the target command (binary or app bundle).
- `--attach <pid|name>`: attach to running process.
- `--output <path>`: `.trace` output. If omitted, file saved in CWD.
- `--time-limit 60s|5m`: set capture duration.
- `--device <name|UDID>`: required for iOS device runs.
- `--target-stdout -`: stream launched process stdout to terminal (useful for CLI tools).

## Exporting Stacks (CLI)

- Inspect trace tables:
  - `xcrun xctrace export --input /tmp/App.trace --toc`
- Export raw time-profile samples:
  - `xcrun xctrace export --input /tmp/App.trace --xpath '/trace-toc/run[@number="1"]/data/table[@schema="time-profile"]' --output /tmp/time-profile.xml`
- Post-process in a script (Python/Rust) to aggregate stacks.

## Instruments UI Workflow

- Template: Time Profiler
- Use “Record” and capture the slow path (startup vs steady-state)
- Call Tree tips:
  - Hide System Libraries
  - Invert Call Tree
  - Separate by Thread
  - Focus on hot frames and call counts

## Gotchas & Fixes

- **Wrong app profiled**: LaunchServices resolves installed app instead of local build.
  - Fix: use direct binary path or `--attach` with known PID.
- **No samples / empty trace**: App exits quickly or never hits work.
  - Fix: longer capture, trigger workload during recording.
- **Privacy prompts**: `xctrace` may need Developer Tools permission.
  - Fix: System Settings → Privacy & Security → Developer Tools → allow Terminal/Xcode.
- **Large XML exports**: `time-profile` exports are huge.
  - Fix: filter with XPath and aggregate offline; don’t print to terminal.

## iOS Specific Notes

- Device: use `xcrun xctrace list devices` and `--device <UDID>`.
- Launch via Xcode if needed; attach with `xctrace --attach`.
- Ensure debug symbols for meaningful stacks.

## Verification Checklist

- Confirm trace process path matches target build.
- Confirm stacks show expected app frames.
- Capture covers the slow operation (startup/refresh). 
- Export stacks for automated diffing if optimizing.

開発の人気スキル

Peter Steinbergerのその他のスキル

データ月:2026-09 · ダウンロード数、スター数、インストール数は公開スキルレジストリ(ClawHub、SkillHub)から月単位で集計しています。詳しくはデータの方法論をご覧ください。