native-app-profiling
Skill787 starsChanged 3 months agoMITView on GitHub
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.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- patrickserrano/skillsword for word, first seen Jan 17, 2026
Other versions1 project uses a version of this.
Word for word · 1
- patrickserrano/skills★ 13100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- animation-vocabularySkill
- apple-designSkill
- app-screenshot-debugSkill
- ascSkill
- bump-versionSkill
- check-ghostty-updateSkill
- code-cleanSkill
- conventional-commitSkill
- dia-source-analysisSkill
- docSkill
- emil-design-engSkill
- find-animation-opportunitiesSkill
- improve-animationsSkill
- ios-app-analysisSkill
- ios-rebuild-devSkill
- issue-creatorSkill
- macos-rebuild-devSkill
- og-generationSkill
- pick-ui-librarySkill
- prototypeSkill
- review-animationsSkill
- review-copySkill
- Swift Performance Optimization SkillSkill
- performance-auditSkill
- termio-bug-reportSkill
- termioSkill
- testflight-releaseSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 60
Look for the load address (typically starts with 0x1...).
- Very specific: line 64
Use atos to symbolicate addresses:
- Distinctive: line 73
Capture duration: If stacks are empty, capture longer or avoid idle time
- Distinctive: line 108
Look for frames with high sample counts
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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:
# 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:
xcrun xctrace record \
--template 'Time Profiler' \
--time-limit 90s \
--output /tmp/App.trace \
--launch -- /path/to/App.app/Contents/MacOS/App2) Export Time Samples
List available schemas in the trace:
xcrun xctrace export --input /tmp/App.trace --tocExport time profile data:
xcrun xctrace export \
--input /tmp/App.trace \
--xpath '/trace-toc/run/data/table[@schema="time-profile"]' \
--output /tmp/time-profile.xml3) Get Load Address for Symbolication
While the app is running, get the __TEXT segment load address:
vmmap <pid> | grep "__TEXT"Look for the load address (typically starts with 0x1...).
4) Symbolicate Stack Frames
Use atos to symbolicate addresses:
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 action that's slow
- Capture duration: If stacks are empty, capture longer or avoid idle time
- Symbol matching: Binary symbols must match the trace (same build)
Available Templates
List all profiling templates:
xcrun xctrace list templatesCommon templates:
Time Profiler- CPU samplingAllocations- Memory allocationsLeaks- Memory leak detectionSystem Trace- System-level activityAnimation Hitches- UI performance
Common Commands
| Task | Command |
| List templates | xcrun xctrace list templates |
| List devices | xcrun xctrace list devices |
| Record help | xcrun xctrace help record |
| Export help | xcrun xctrace help export |
| Get PID | pgrep -x "AppName" |
| Get load address | vmmap <pid> | grep __TEXT |
| Symbolicate | atos -o <binary> -l <load-addr> <address> |
Analyzing Results
Manual Analysis
- Export the trace to XML
- Parse the call tree data
- Look for frames with high sample counts
- Focus on your app's code (filter out system frameworks)
Identify Hotspots
Look for:
- Functions with high self-time (time spent in function itself)
- Deep call stacks indicating inefficient algorithms
- Repeated patterns suggesting optimization opportunities
Gotchas
- ASLR: Runtime
__TEXTload address changes each launch - get it fromvmmap - Build mismatch: Symbols must match the exact build that was profiled
- Idle time: Profiling idle app produces empty/useless data
- Permissions: May need to run with
sudofor some operations
iOS Profiling
For iOS apps on simulator:
xcrun xctrace record \
--template 'Time Profiler' \
--device <simulator-udid> \
--time-limit 60s \
--output /tmp/iOS-App.trace \
--launch -- <bundle-id>Get simulator UDID:
xcrun simctl list devices | grep BootedAutomation Script
Basic recording script:
#!/bin/bash
set -e
APP_NAME="$1"
DURATION="${2:-60}"
OUTPUT="${3:-/tmp/$APP_NAME.trace}"
if [ -z "$APP_NAME" ]; then
echo "Usage: $0 <app-name> [duration-seconds] [output-path]"
exit 1
fi
PID=$(pgrep -x "$APP_NAME" || true)
if [ -n "$PID" ]; then
echo "Attaching to running $APP_NAME (PID: $PID)"
xcrun xctrace record \
--template 'Time Profiler' \
--time-limit "${DURATION}s" \
--output "$OUTPUT" \
--attach "$PID"
else
echo "App not running. Please start $APP_NAME first."
exit 1
fi
echo "Trace saved to: $OUTPUT"
echo "To analyze: xcrun xctrace export --input $OUTPUT --toc"Checklist
- Correct binary path identified
- App running or launch command ready
- Slow path reproducible
- Trace recorded during problematic behavior
- Load address captured for symbolication
- Results analyzed for hotspots
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

