Native App Performance

Native macOS/iOS app performance profiling via xctrace/Time Profiler and CLI-only analysis of Instruments traces. Use when asked to profile, attach, record, or analyze Instruments .trace files, find hotspots, or optimize native app performance without opening Instruments UI.

MIT-0 · Free to use, modify, and redistribute. No attribution required.
5 · 1.9k · 4 current installs · 4 all-time installs
byPeter Steinberger@steipete
MIT-0
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (xctrace/Time Profiler, Instruments .trace analysis) match the included scripts and SKILL.md. All required tools invoked (xcrun/xctrace, atos, otool, vmmap) are appropriate for profiling native macOS/iOS apps. No unrelated credentials, config paths, or external services are requested.
Instruction Scope
SKILL.md instructs only local profiling steps (record via xctrace, export time-sample XML, get __TEXT load address via vmmap, symbolicate with atos) and references only local files, PIDs, and binaries. The scripts read .trace bundles and binaries and produce local output; they do not instruct reading unrelated user files, scanning system configuration, or transmitting data to external endpoints.
Install Mechanism
No install spec; this is instruction-plus-scripts only. That is low-risk: nothing is downloaded or installed by the skill. It assumes standard macOS developer tools are available on PATH.
Credentials
No environment variables, credentials, or config paths are required. The toolchain invoked (xcrun, atos, otool, vmmap, ripgrep if used) is proportional to the stated task. The scripts interact only with user-supplied trace files, binaries, and PIDs.
Persistence & Privilege
always:false and normal invocation are used. The skill does not request persistent/system-wide privileges or attempt to modify other skills or agent configuration. It runs ad-hoc tooling and exits.
Assessment
This skill appears coherent and focused on local macOS/iOS profiling. Before installing or running it: (1) confirm you're on macOS with Xcode command-line tools (xcrun/xctrace, atos, otool, vmmap) available; (2) review the included scripts (they invoke subprocesses) and only supply trace files, binary paths, or PIDs you trust; (3) be aware the scripts execute local developer tools and read files but do not perform network calls or request credentials; (4) run in a controlled environment if you are concerned about running arbitrary scripts — but functionally these scripts perform exactly the profiling/symbolication tasks described.

Like a lobster shell, security has layers — review code before you run it.

Current versionv1.0.0
Download zip
latestvk974bfer6s1pje64rmfc3b3ybh7ym0ry

License

MIT-0
Free to use, modify, and redistribute. No attribution required.

SKILL.md

Native App Performance (CLI-only)

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

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>
  1. Record Time Profiler (launch):
xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --launch -- /path/App.app/Contents/MacOS/App
  1. Extract time samples:
scripts/extract_time_samples.py --trace /tmp/App.trace --output /tmp/time-sample.xml
  1. Get load address for symbolication:
# While app is running
vmmap <pid> | rg -m1 "__TEXT" -n
  1. 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 record and xcrun xctrace help export show 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 __TEXT load address from vmmap.
  • If using a new build, update the --binary path; symbols must match the trace.
  • CLI-only flow: no need to open Instruments if stacks are symbolicated via atos.

Files

4 total
Select a file
Select a file to preview.

Comments

Loading comments…