debugging-macos

Diagnose macOS 26+ app crashes, hangs, leaks, and sandbox violations with LLDB, Instruments, os_log, and dtrace.

1|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/LaughingJackalope/macos-skills --skill debugging-macos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debugging-macos
Source: https://github.com/LaughingJackalope/macos-skills/tree/main/debugging-macos
Command: npx skills add https://github.com/LaughingJackalope/macos-skills --skill debugging-macos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates the guesswork and time wasted diagnosing elusive crashes, main thread hangs, memory leaks, and sandbox violations in macOS apps, which require specialized platform-specific tools and knowledge to resolve efficiently.

Core Features & Use Cases

  • Full Native Debugging Toolkit: Covers LLDB for AppKit/Swift breakpoint debugging, Memory Graph Debugger for retain cycle detection, Instruments templates for hangs/GPU/memory profiling, os_log/os_signpost for structured logging and performance tracing, dtrace for kernel-level system tracing, crash report symbolication, sandbox violation diagnostics, and sanitizers (ASan, TSan, UBSan, Main Thread Checker) for undefined behavior detection.
  • Real-World Use Case: If your macOS app experiences a main thread hang during window resizing, use this skill to profile with the Instruments Hangs template, correlate with os_signpost intervals, and identify the blocking synchronous dispatch call causing the stall.
  • Real-World Use Case: If your app crashes with a hex-only stack trace, use this skill to symbolicate the crash report with atos using the matching dSYM UUID to pinpoint the exact failing line of code.

Quick Start

Use the debugging-macos skill to diagnose the random EXC_BAD_ACCESS crash occurring when dismissing modal windows in your macOS app, starting with symbolication of the latest crash report.

Frequently Asked Questions about debugging-macos

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

FAQPage Schema
How do I symbolicate a macOS crash report with a hex-only stack trace?

To symbolicate a macOS crash report, use the atos command with the matching dSYM UUID to map hex addresses to exact failing lines of code. This resolves unreadable stack traces into specific function names and line numbers.

Why does my macOS app experience a main thread hang during window resizing?

A main thread hang during window resizing is caused by blocking synchronous dispatch calls. Profile the stall using the Instruments Hangs template and correlate os_signpost intervals to identify the exact blocking operation.

How do I detect memory retain cycles in a SwiftUI or AppKit application?

Detect memory retain cycles in SwiftUI or AppKit by using the Memory Graph Debugger to visualize object allocations. This native tool traces reference counts to pinpoint exactly where objects are improperly retained.

Can I use AddressSanitizer and ThreadSanitizer to diagnose macOS sandbox violations?

AddressSanitizer and ThreadSanitizer diagnose undefined behavior and threading issues, while sandbox violations require dedicated entitlement compliance diagnostics. Use sanitizers like ASan, TSan, and UBSan for memory and threading bugs.

What is the best way to trace kernel-level system calls in macOS apps?

The best way to trace kernel-level system calls in macOS apps is using dtrace for kernel-level tracing. This mechanism provides deep system insight by dynamically intercepting and recording kernel function calls.

Does os_log structured logging work with Instruments performance profiling?

os_log structured logging works directly with Instruments by using os_signpost intervals to correlate custom log events with performance profiling data. This integration maps app-specific events to system resource usage.