/ios-swift-skills:native-app-profilingfrom ios-swift-skills
Profiles native macOS/iOS apps using xctrace Time Profiler via CLI. Records CPU samples, exports trace data, symbolicates with atos, and identifies performance hotspots without opening Instruments.
Ships in ios-swift-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Record Time Profiler via xctrace, extract samples, symbolicate, and identify hotspots without opening Instruments.
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/App
List available schemas in the trace:
xcrun xctrace export --input /tmp/App.trace --toc
Export time profile data:
xcrun xctrace export \
--input /tmp/App.trace \
--xpath '/trace-toc/run/data/table[@schema="time-profile"]' \
--output /tmp/time-profile.xml
While the app is running, get the __TEXT segment load address:
vmmap <pid> | grep "__TEXT"
Look for the load address (typically starts with 0x1...).
Use atos to symbolicate addresses:
atos -o /path/to/App.app/Contents/MacOS/App -l 0x100000000 <address>
List all profiling templates:
xcrun xctrace list templates
Common templates:
Time Profiler - CPU samplingAllocations - Memory allocationsLeaks - Memory leak detectionSystem Trace - System-level activityAnimation Hitches - UI performance| 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> |
Look for:
__TEXT load address changes each launch - get it from vmmapsudo for some operationsFor 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 Booted
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"
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
xctrace, time-profiler, cpu-profiling, symbolication, instruments-cli
Generated from the plugin's indexed repository (patrickserrano/skills) — no native marketplace selected
npx claudepluginhub p/patrickserrano-ios-swift-skills10 skills in this plugin
/issue-fix-flowEnd-to-end GitHub issue fix workflow using gh CLI, local code changes, builds/tests, and git push. Use when asked to take an issue number, implement a fix, run builds/tests, commit with a closing message, and push./debugger-agentBuild, run, and debug iOS apps on a simulator. Use when asked to run an iOS app, interact with the simulator UI, capture logs, or diagnose runtime behavior./app-store-changelogCreate user-facing App Store release notes from git history. Use when asked to generate release changelog, App Store "What's New" text, or release notes based on git tags./macos-spm-app-packagingScaffold, build, and package SwiftPM-based macOS apps without Xcode project. Use when you need a from-scratch macOS app layout, SwiftPM targets/resources, custom .app bundle assembly, or signing/notarization steps outside Xcode./concurrency-expertSwift Concurrency review and remediation for Swift 6.2+. Use when asked to review Swift Concurrency usage, improve concurrency compliance, or fix Swift concurrency compiler errors./liquid-glassImplement, review, or improve SwiftUI features using the iOS 26+ Liquid Glass API. Use when asked to adopt Liquid Glass in SwiftUI UI, refactor to Liquid Glass, or review Liquid Glass usage.Other plugins' skills for the same job