instruments-profiling_skill

This skill helps profile macOS/iOS native apps with Instruments/xctrace, ensuring correct binary selection and actionable stack analysis.
  • Python

2.5k

GitHub Stars

2

Bundled Files

6 months ago

Catalog Refreshed

8 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill openclaw/skills --skill instruments-profiling

  • _meta.json296 B
  • SKILL.md3.7 KB

Overview

This skill teaches how to profile native macOS and iOS apps using Instruments and the xctrace CLI. It focuses on correct binary selection, common command arguments, exporting stack data, and frequent gotchas you will encounter when capturing Time Profiler traces. Use it to produce reliable traces and actionable stack exports for performance analysis.

How this skill works

The skill guides you through recording Time Profiler sessions either by launching a specific binary or attaching to a running process, using xctrace record and related commands. It shows how to verify the traced process, export raw time-profile samples via xctrace export, and prepare stack data for post-processing and diffing. It highlights diagnostics and fixes for empty traces, wrong targets, privacy permissions, and iOS device usage.

When to use it

  • When you need CPU hotspots or call stacks for native macOS or iOS apps
  • When verifying that a local build—not an installed app—is being profiled
  • When automating trace capture and exporting time-profile samples for analysis
  • When diagnosing empty or incomplete traces and permission issues
  • When capturing traces from a specific device or UDID for iOS

Best practices

  • Launch the exact binary path (e.g., /path/App.app/Contents/MacOS/App) for deterministic profiling
  • After launch, confirm the process path with ps -p <pid> -o comm= -o command= before trusting the trace
  • Use --time-limit long enough to exercise the workload and avoid empty traces
  • Use xctrace export with XPath to extract only the time-profile table and avoid huge XML dumps
  • Ensure Developer Tools permission and matching debug symbols for readable stacks

Example use cases

  • Record a 60s Time Profiler session by launching a local build and export the time-profile table for offline aggregation
  • Attach xctrace to a running simulator process by PID to capture a specific UI interaction
  • Profile a CLI tool and stream stdout with --target-stdout - while capturing CPU samples
  • Collect traces from a physical iOS device by specifying --device <UDID> and exporting stacks for symbolication
  • Automate nightly captures and export XML stacks for regression-aware performance diffs

FAQ

LaunchServices can resolve a different installed bundle. Use the direct binary path or attach to a known PID to guarantee the target.

My trace is empty or has no samples. What should I check?

Verify the app actually did work during the capture, increase the time limit, and confirm the process stayed alive while recording.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational