native-app-profiling

Featured

Profile native macOS/iOS apps using Time Profiler via CLI (xctrace). Use when asked to identify performance hotspots, profile CPU usage, or diagnose slow code paths without opening Instruments.

AI & Automation 436 stars 36 forks Updated today MIT

Install

View on GitHub

Quality Score: 89/100

Stars 20%
88
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Native App Performance Profiling (CLI) ## Overview Record Time Profiler via `xctrace`, extract samples, symbolicate, and identify hotspots without opening Instruments. ## Quick Start ### 1) Record Time Profiler **Attach to running process:** ```bash # Get the PID first pgrep -x "AppName" # Record for 90 seconds xcrun xctrace record \ --template 'Time Profiler' \ --time-limit 90s \ --output /tmp/App.trace \ --attach <pid> ``` **Launch and record:** ```bash xcrun xctrace record \ --template 'Time Profiler' \ --time-limit 90s \ --output /tmp/App.trace \ --launch -- /path/to/App.app/Contents/MacOS/App ``` ### 2) Export Time Samples List available schemas in the trace: ```bash xcrun xctrace export --input /tmp/App.trace --toc ``` Export time profile data: ```bash xcrun xctrace export \ --input /tmp/App.trace \ --xpath '/trace-toc/run/data/table[@schema="time-profile"]' \ --output /tmp/time-profile.xml ``` ### 3) Get Load Address for Symbolication While the app is running, get the `__TEXT` segment load address: ```bash vmmap <pid> | grep "__TEXT" ``` Look for the load address (typically starts with `0x1...`). ### 4) Symbolicate Stack Frames Use `atos` to symbolicate addresses: ```bash atos -o /path/to/App.app/Contents/MacOS/App -l 0x100000000 <address> ``` ## Workflow Notes - **Correct binary**: Confirm you're profiling the right build (local vs /Applications) - **Trigger the slow path**: During capture, perform the act...

Details

Author
termio-sh
Repository
termio-sh/termio
Created
3 months ago
Last Updated
today
Language
Swift
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category