Skills

Debugging Instruments

Debug iOS apps and profile performance using LLDB, the interactive Memory Graph...

Install

npx skills add dpearson2699/swift-ios-skills --skill debugging-instruments -g -a claude-code -y
Category
Testing
Updated
3mo ago
License
See repository
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Debug iOS apps and profile performance using LLDB, the interactive Memory Graph Debugger, and Instruments. Use for crashes, retain-cycle inspection, hangs, build failures, and generic CPU, memory, energy, or network profiling. Use ios-memgraph-analysis for .memgraph capture, leaks CLI ownership paths, or persistent heap growth; use ios-ettrace-performance for ETTrace capture and JSON.

Debugging and Instruments

Keep interactive graph and Instruments triage here. Route detailed .memgraph command-line ownership/growth analysis and ETTrace work to their focused skills.

Contents

LLDB Debugging

Start with a small, repeatable workflow:

  1. Reproduce in a Debug build and stop at the narrowest useful breakpoint.
  2. Inspect locals without executing code, then capture the current stack.
  3. Move to the relevant frame or thread and verify the failing state.
  4. Add a condition or watchpoint only when the bad transition is still unclear.
(lldb) br set -f ViewModel.swift -l 42     # Stop at file and line
(lldb) v myLocal                           # Inspect without executing code
(lldb) po myObject                         # Use debugDescription when needed
(lldb) bt all                              # Capture every thread's backtrace
(lldb) frame select 3                      # Inspect a relevant frame
(lldb) br modify 1 -c "count > 10"         # Narrow a noisy breakpoint
(lldb) w set v self.score                  # Stop on an unexpected write

Use v over po when you only need a local variable value, it does not execute code and cannot trigger side effects. Expression evaluation can execute or mutate program state, and hardware watchpoints are scarce, so use both deliberately.

Load references/lldb-patterns.md for the complete inspection, breakpoint/logpoint, expression, watchpoint, thread navigation, and symbolic-breakpoint command tables.

Memory Debugging

Memory Graph Debugger Workflow

Read the whole SKILL.md on GitHub

More in Testing