Help us improve
Share bugs, ideas, or general feedback.
From apple-docs
Profile application performance using Instruments - find CPU bottlenecks, memory leaks, and more.
npx claudepluginhub briannadoubt/claude-marketplace --plugin apple-docsHow this skill is triggered — by the user, by Claude, or both
Slash command
/apple-docs:profile-appThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Profile application performance using Instruments - find CPU bottlenecks, memory leaks, and more.
Profiles iOS app performance with Instruments: Time Profiler for CPU, Allocations and Leaks for memory, Network for traffic, Energy Log for battery impact. Optimizes launch times, scrolling, and energy use.
Debug iOS apps and profile performance using LLDB, Memory Graph Debugger, and Instruments. Use when diagnosing crashes, memory leaks, retain cycles, main thread hangs, or performance bottlenecks.
Debugs iOS, Android, and React Native mobile apps for crashes, memory leaks, performance issues, network problems using Xcode Instruments, Android Profiler, LLDB, Logcat.
Share bugs, ideas, or general feedback.
Profile application performance using Instruments - find CPU bottlenecks, memory leaks, and more.
# See all profiling templates
xcrun xctrace list templates
Common templates:
# Find your app's PID
pgrep -l MyApp
# Profile with Time Profiler for 10 seconds
xcrun xctrace record \
--template "Time Profiler" \
--attach $(pgrep MyApp) \
--time-limit 10s \
--output /tmp/profile.trace
# Profile from launch
xcrun xctrace record \
--template "Time Profiler" \
--launch -- /path/to/MyApp.app/Contents/MacOS/MyApp \
--time-limit 30s \
--output /tmp/launch.trace
# First, get the app's PID on the simulator
xcrun simctl spawn booted launchctl list | grep myapp
# Profile simulator process
xcrun xctrace record \
--template "Time Profiler" \
--device "iPhone 16" \
--attach com.example.myapp \
--time-limit 10s \
--output /tmp/profile.trace
# Open trace file in Instruments GUI
open /tmp/profile.trace
# List available instruments in trace
xcrun xctrace export --input /tmp/profile.trace --toc
# Export to XML
xcrun xctrace export --input /tmp/profile.trace --output /tmp/export.xml
# Time Profiler - see where CPU time is spent
xcrun xctrace record \
--template "Time Profiler" \
--attach $(pgrep MyApp) \
--time-limit 30s \
--output /tmp/cpu.trace
Look for:
# Allocations - track all memory allocations
xcrun xctrace record \
--template "Allocations" \
--attach $(pgrep MyApp) \
--time-limit 30s \
--output /tmp/memory.trace
# Leaks - find memory leaks
xcrun xctrace record \
--template "Leaks" \
--attach $(pgrep MyApp) \
--time-limit 60s \
--output /tmp/leaks.trace
# System Trace for UI hangs
xcrun xctrace record \
--template "System Trace" \
--attach $(pgrep MyApp) \
--time-limit 10s \
--output /tmp/system.trace
# Energy profiling (device recommended)
xcrun xctrace record \
--template "Energy Log" \
--attach $(pgrep MyApp) \
--time-limit 60s \
--output /tmp/energy.trace
For more complex analysis, use Instruments.app:
# Open Instruments
open -a Instruments
# Or with a specific template
open -a Instruments --args -t "Time Profiler"
# Check memory usage
ps aux | grep MyApp | awk '{print $6/1024 " MB"}'
# Detailed memory (macOS)
vmmap $(pgrep MyApp) | tail -5
# Watch CPU usage
top -pid $(pgrep MyApp) -l 5
# Check file handles
lsof -p $(pgrep MyApp) | wc -l
--template exactly as shown by xctrace list templatesFor integrated profiling with parsed results:
instruments_profile - Profile and get parsed summarylist_instruments_templates - List available templatesThese tools handle the complexity of finding the right process and return structured summaries instead of raw trace files.