instruments-profiling

Profile macOS/iOS apps using Instruments time profiler and xctrace CLI.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/Khang5687/agent-scripts --skill instruments-profiling-khang5687
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: instruments-profiling
Source: https://github.com/Khang5687/agent-scripts/tree/main/skills/instruments-profiling
Command: npx skills add https://github.com/Khang5687/agent-scripts --skill instruments-profiling-khang5687

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires xctrace, and includes scripts (resource) components.

What problem does it solve?

This Skill provides instant performance profiling and stack analysis for native macOS/iOS apps, streamlining the process of identifying and resolving performance issues.

Core Features & Use Cases

  • Time Profiler: Record detailed performance data for apps.
  • xctrace CLI: Use command-line tools for profiling and exporting traces.
  • Binary Selection: Accurately select and profile the correct binary/app instance.
  • Use Case: When a user wants to analyze the performance of a mobile app and identify slow operations or memory leaks.

Quick Start

To profile an app with Time Profiler for 60 seconds, use the command: xcrun xctrace record --template 'Time Profiler' --time-limit 60s --output /tmp/App.trace --launch -- /path/To/App.app

Frequently Asked Questions about instruments-profiling

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

FAQPage Schema
How do I profile a macOS or iOS app for performance issues?

To profile a macOS or iOS app, use the xctrace CLI with a Time Profiler template to record performance data, selecting the target binary to identify slow operations. This requires the xctrace tool and Instruments to capture trace data.

Can I run xctrace profiling from the command line?

Yes, xctrace profiling can be run from the command line using the xctrace CLI. You can launch an app, apply a Time Profiler template, and export trace data directly without needing the graphical interface.

How do I use the Time Profiler template with xctrace to analyze an app?

Use the Time Profiler template with xctrace by specifying the template name, time limit, and output path in your command. You must also launch the target binary to ensure accurate performance data collection during the recording.

Do I need to select a specific binary for accurate xctrace performance data?

Yes, selecting the correct binary or app instance is required for accurate xctrace performance data. Binary selection ensures the profiler captures stack analysis and execution metrics strictly for your target native app.

What macOS profiling tool is best for resolving native app memory leaks?

For resolving native app memory leaks, macOS profiling with xctrace and Instruments is recommended. It records detailed app performance data and stack traces to help identify slow operations and memory issues.

Why does xctrace profiling require the Instruments app?

xctrace profiling requires the Instruments app because xctrace acts as its command-line interface. Instruments provides the underlying templates and data processing engine needed to record and export app trace files.