Native app performance

From mouadja02/skills · View interactive version

Native app performance is an AI agent skill from the GitHub repository mouadja02/skills. Profiles native macOS and iOS apps from the command line only: xctrace recording, Time Profiler samples, hotspot ranking, and symbolication with atos and vmmap. Use for headless or SSH-based performance analysis without opening the Instruments GUI.

How to use this skill

Skill file

Native App Performance (CLI-only)

Attribution: Sourced from steipete/agent-scripts by Peter Steinberger.

Goal: record Time Profiler via xctrace, extract samples, symbolicate, and propose hotspots without opening Instruments.

Related skill: For Instruments UI workflows and trace export details, see instruments-profiling.

When to Use

Quick Start (CLI)

1. Record Time Profiler (attach)

# Start app yourself, then attach
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --attach <pid>

2. Record Time Profiler (launch)

xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --launch -- /path/App.app/Contents/MacOS/App

3. Extract time samples

xcrun xctrace export --input /tmp/App.trace \
  --xpath '/trace-toc/run[@number="1"]/data/table[@schema="time-profile"]' \
  --output /tmp/time-sample.xml

4. Get load address for symbolication

# While app is running
vmmap <pid> | rg -m1 "__TEXT" -n

5. Symbolicate + rank hotspots

# Symbolicate using atos
atos -o /path/App.app/Contents/MacOS/App -l <load-address> <address>

Workflow Notes

Gotchas

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.