Agent skills for iOS, iPadOS, Swift, SwiftUI, and modern Apple framework development.
71
89%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Advisory
Suggest reviewing before use
Detailed template-by-template guide for profiling iOS apps with Instruments. Companion to the main debugging-instruments skill.
Always profile on a physical device for accurate measurements. Simulator performance does not reflect real-world behavior.
When to use: CPU is high, UI is slow, animations stutter, or you need to find which functions consume the most time.
Focus on functions with high Self Weight — these are doing the actual work.
When to use: Memory grows over time, you suspect objects are not being freed, or you need to track object lifetimes.
Focus on "Created & Still Living" objects in the generation diff — these are your potential leaks.
Enable the Allocations List and sort by Persistent Bytes. Look for:
When to use: Suspected retain cycles or abandoned memory.
Leaks instrument commonly catches:
When to use: Inspecting HTTP request/response timing, payload sizes, or connection reuse.
When to use: SwiftUI view body is evaluated too frequently, unnecessary redraws, or identity churn in lists.
swiftui-performance skill for remediation patterns.When to use: Frame drops, off-screen rendering, excessive blending.
| Issue | Indicator | Fix |
|---|---|---|
| Transparent overlapping views | Red blended layers | Use opaque backgrounds |
| Corner radius + clip | Off-screen rendering | Use cornerCurve with pre-masked images |
| Shadow without path | Off-screen rendering | Set shadowPath explicitly |
| Large images not downsampled | High memory + slow rendering | Downsample before display |
When to use: Battery drain complaints, background energy impact, or App Store rejection for excessive energy use.
When to use: Slow file operations, excessive disk I/O, or disk write exceptions from MetricKit.
When to use: Deep investigation of thread scheduling, virtual memory faults, system calls, and inter-process communication.
This is the most advanced template — use it after Time Profiler when you need OS-level detail.
# Record Time Profiler trace
xcrun xctrace record \
--template "Time Profiler" \
--device "iPhone" \
--output ~/traces/profile.trace \
--time-limit 30s \
--launch com.example.MyApp
# Record Allocations trace for a running app
xcrun xctrace record \
--template "Allocations" \
--device "iPhone" \
--output ~/traces/alloc.trace \
--attach com.example.MyApp
# Record with multiple instruments
xcrun xctrace record \
--template "Time Profiler" \
--template "Allocations" \
--output ~/traces/combined.trace \
--launch com.example.MyApp# List available tables in a trace
xcrun xctrace export --input profile.trace --toc
# Export specific table as XML
xcrun xctrace export --input profile.trace \
--xpath '/trace-toc/run/data/table[@schema="time-profile"]'
# Export to a file
xcrun xctrace export --input profile.trace \
--xpath '/trace-toc/run/data/table[@schema="time-profile"]' \
--output profile_data.xml# Available templates
xcrun xctrace list templates
# Connected devices
xcrun xctrace list devices
# Running processes on a device
xcrun xctrace list processes --device "iPhone"import os
let signposter = OSSignposter(subsystem: "com.example.app", category: "Networking")
func fetchUser(id: String) async throws -> User {
let state = signposter.beginInterval("fetchUser", id: signposter.makeSignpostID())
defer { signposter.endInterval("fetchUser", state) }
let (data, _) = try await URLSession.shared.data(from: userURL(id))
signposter.emitEvent("dataReceived", "\(data.count) bytes")
return try JSONDecoder().decode(User.self, from: data)
}Signposts emitted through MXMetricManager.makeLogHandle(category:) are
also reported in MetricKit payloads. See the metrickit skill
for details on custom signpost metrics.
Create a shell script for CI:
#!/bin/bash
set -euo pipefail
APP_BUNDLE="build/MyApp.app"
TRACE_OUTPUT="traces/ci_profile_$(date +%s).trace"
TEMPLATE="Time Profiler"
# Record trace
xcrun xctrace record \
--template "$TEMPLATE" \
--output "$TRACE_OUTPUT" \
--time-limit 60s \
--launch "$APP_BUNDLE"
# Export data for analysis
xcrun xctrace export \
--input "$TRACE_OUTPUT" \
--toc > "traces/toc.xml"
echo "Trace saved to $TRACE_OUTPUT"Complement Instruments with in-test measurements:
func testScrollPerformance() {
let app = XCUIApplication()
app.launch()
let measureOptions = XCTMeasureOptions()
measureOptions.iterationCount = 5
measure(metrics: [
XCTClockMetric(),
XCTCPUMetric(),
XCTMemoryMetric(),
XCTStorageMetric()
], options: measureOptions) {
app.swipeUp()
app.swipeDown()
}
}Set performance baselines in Xcode to automatically flag regressions in CI.
skills
accessorysetupkit
references
activitykit
references
adattributionkit
references
alarmkit
references
app-clips
app-intents
references
app-store-optimization
app-store-review
apple-on-device-ai
appmigrationkit
references
audioaccessorykit
references
authentication
references
avkit
references
background-processing
references
browserenginekit
references
callkit
references
carplay
references
cloudkit
references
contacts-framework
references
core-bluetooth
references
core-data
core-motion
references
core-nfc
references
coreml
references
cryptokit
references
cryptotokenkit
references
debugging-instruments
device-integrity
references
dockkit
references
energykit
references
eventkit
references
financekit
references
focus-engine
gamekit
references
healthkit
references
homekit
references
ios-accessibility
ios-localization
ios-networking
ios-simulator
references
mapkit
metrickit
references
musickit
references
natural-language
references
paperkit
references
passkit
references
pdfkit
references
pencilkit
references
permissionkit
references
photokit
push-notifications
realitykit
references
relevancekit
references
scenekit
references
sensorkit
references
speech-recognition
spritekit
references
storekit
swift-api-design-guidelines
swift-architecture
swift-charts
references
swift-codable
swift-concurrency
swift-formatstyle
swift-language
swift-security
references
swift-testing
swiftdata
swiftlint
swiftui-animation
swiftui-gestures
references
swiftui-layout-components
swiftui-liquid-glass
references
swiftui-patterns
swiftui-performance
swiftui-uikit-interop
swiftui-webkit
tabletopkit
references
tipkit
references
vision-framework
weatherkit
references
widgetkit
references