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.
The 'native-app-performance' skill provides a powerful CLI-based solution for profiling macOS/iOS app performance without needing to open the Instruments UI. By leveraging xctrace's Time Profiler template and offering a set of Python scripts for analyzing .trace files, this skill enables users to efficiently detect performance bottlenecks, extract time samples, symbolicate, and rank hotspots. It allows developers to focus on app performance optimization directly from the command line, offering an essential toolset for anyone looking to improve the efficiency of native apps on macOS/iOS platforms.
You can record a Time Profiler trace by using the command `xcrun xctrace record --template 'Time Profiler' --time-limit 90s --output /tmp/App.trace --attach <pid>` after starting the app. Alternatively, you can launch the app directly using `--launch`.
Extracting time samples from a trace helps you capture detailed performance data of the app, which can then be analyzed to identify slow or inefficient parts of the application.
Yes, this skill is designed for CLI-only usage, allowing you to analyze Instruments .trace files without launching the Instruments UI. You can symbolicate and rank hotspots directly via command-line scripts.
The skill requires macOS/iOS devices, along with the 'xcrun' tool for running xctrace commands. It also requires Python scripts for sample extraction and hotspot ranking, and the appropriate binary paths for symbolication.
It is recommended to use the direct binary path for profiling, especially for local builds. If profiling apps from `/Applications`, ensure you're working with the correct binary and symbols to avoid discrepancies.
Quick Setup:
.claude/skills/Repository
steipete/agent-scripts