Debug iOS apps and profile performance using LLDB, Memory Graph Debugger, and Instruments. Use when diagnosing crashes, memory leaks, retain cycles, main thread hangs, slow rendering, build failures, or when profiling CPU, memory, energy, and network usage.
Detected risks:
This skill provides comprehensive debugging and performance profiling capabilities for iOS applications using Apple's native developer tools: LLDB debugger, Memory Graph Debugger, and Instruments. It addresses critical development challenges including application crashes, memory leaks, retain cycles, main thread hangs, slow UI rendering, and build failures. The skill guides developers through diagnostic workflows to identify root causes quickly and resolve issues efficiently.
The skill covers essential LLDB commands for runtime inspection, breakpoint management, expression evaluation, and watchpoints for tracking variable mutations. It includes memory debugging techniques using the Memory Graph Debugger to detect retain cycles and analyze object graphs. For performance issues, it provides hang diagnostics to identify main thread blockages and build failure triage strategies. The Instruments profiling section covers CPU usage analysis, memory allocation tracking, energy consumption monitoring, and network activity profiling.
This skill is designed for iOS developers working with Swift and Objective-C applications who need to diagnose production issues, optimize app performance, or understand complex runtime behavior. It's particularly valuable when dealing with non-deterministic bugs, performance degradation, or when preparing apps for App Store submission. Both junior developers learning debugging fundamentals and senior engineers investigating subtle issues will find practical workflows and commands for their daily development tasks.
Use `v` (frame variable) when you only need to see a local variable's value because it's faster and doesn't execute any code. Use `po` when you need the object's description or when inspecting complex objects, but be aware that `po` executes code and can trigger side effects.
Watchpoints are hardware-backed and limited to approximately 4 concurrent watchpoints on ARM architecture. They're best used strategically to track unexpected mutations of specific variables rather than monitoring many variables simultaneously.
After modifying view properties in the debugger, call `CATransaction.flush()` to force an immediate UI update without resuming program execution. This allows you to verify visual changes instantly.
This skill covers the Memory Graph Debugger for detecting retain cycles and analyzing object graphs, along with LLDB commands for runtime inspection. It also references Instruments profiling for memory allocation tracking.
Yes, symbolic breakpoints allow you to set breakpoints on methods by name without knowing the file location. This is useful for debugging system frameworks, third-party libraries, or setting breakpoints on common diagnostic points like malloc errors or Auto Layout constraint issues.
Quick Setup:
.claude/skills/Repository
dpearson2699/swift-ios-skills