instruments-profiling

Profiles native macOS/iOS apps using Instruments/xctrace Time Profiler to identify bottlenecks and hot paths.

1|1|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/BumpyClock/dotfiles --skill instruments-profiling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instruments-profiling
Source: https://github.com/BumpyClock/dotfiles/tree/main/.ai_agents/skills/instruments-profiling
Command: npx skills add https://github.com/BumpyClock/dotfiles --skill instruments-profiling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Profiling native macOS and iOS apps to identify performance bottlenecks, hot paths, and inefficient code paths using Instruments and xctrace.

Core Features & Use Cases

  • Native app profiling with Time Profiler, proper binary selection to ensure meaningful traces.
  • CLI-based workflow to record, attach, and export traces for analysis.
  • Use Case: Optimize startup time, frame rate, and CPU usage by isolating hot functions and validating results across builds.

Quick Start

List available xctrace templates and start a Time Profiler trace for your app with a 60-second limit, saving the resulting .trace for review in Instruments.

Frequently Asked Questions about instruments-profiling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I profile an iOS app to identify performance bottlenecks using xctrace?

Profile an iOS app by selecting the correct binary and using the xctrace CLI to record a Time Profiler trace, which captures hot paths and inefficient code segments for performance analysis. You can save the resulting .trace file for review in Instruments.

What's the best way to analyze startup time and CPU usage for a native macOS app?

Analyze startup time and CPU usage by running a Time Profiler trace via the xctrace command line. This workflow isolates hot functions during startup and long-running tasks, allowing you to validate performance improvements across different builds.

Can I record a time-limited Instruments trace for my app from the command line?

Record time-limited traces using the xctrace CLI by specifying a duration limit, such as 60 seconds. This captures a focused snapshot of app performance, attaches to the target process, and exports the trace data for later analysis.

Why does my Instruments trace show meaningless data when profiling my macOS app?

Instruments traces show meaningless data when the wrong binary is targeted. Careful binary selection and verifying the process path ensures the Time Profiler attaches to the correct native app, producing accurate stack analysis and hot path identification.

Does xctrace support exporting trace data for offline performance analysis?

xctrace supports exporting recorded trace data through the CLI. By properly targeting the device and binary during recording, you can export the .trace file for offline review in Instruments to inspect stack traces and performance bottlenecks.

When do I need to use Time Profiler instead of other Instruments templates for stack analysis?

Use Time Profiler when you need to isolate hot functions and identify inefficient code paths in native macOS or iOS apps. It samples the stack at intervals to show where CPU time is spent, making it ideal for startup profiling and long-running task analysis.