An agent skill that teaches AI coding agents like Claude Code, Codex, Cursor, and Gemini to debug Apple platform apps the way an experienced iOS engineer does: with LLDB and Xcode, in the running process, without rebuilding to test every guess.
It uses the Agent Skills format, so it works with Claude Code, Codex, Gemini, Cursor, and more.
- Fundamentals - how LLDB is wired (debugger plus embedded compiler), command grammar,
--and backticks,help/apropos, the five command families,vvspvspovsexpression, frame-dependent language contexts (Swift vs Objective-C),$variables and$R0results, format shorthands, settings, and a map from Xcode's UI to LLDB commands - Attaching and running - Run Without Building, attach by name, PID, or wait-for, stdout ownership when attaching, launch arguments and environment variables that unlock diagnostics, scheme Diagnostics (sanitizers, Main Thread Checker, Zombies, Malloc Stack Logging), per-project LLDB init files, and driving LLDB in batch mode from a terminal or an agent with
detachdiscipline - Breakpoints - line, column, symbolic, regex, selector, source-pattern, address, Exception, Swift Error, Runtime Issue, Constraint Error, and Test Failure breakpoints; the Xcode breakpoint editor (conditions, ignore counts, log messages, shell commands, auto-continue); dependent one-shot breakpoints; breakpoint names;
raise(SIGSTOP)for hot loops; diagnosing unresolved symbolic breakpoints; stop hooks;breakpoint write/read - Inspecting state - frames, threads,
bt all, objects by raw address in both languages, registers and$arg1/$arg2in assembly frames with the arm64 and x86_64 conventions,image lookup, Objective-C runtime introspection (_ivarDescription,_methodDescription,class-table dump), memory reads and dumps, disassembly, globals reachable from a cold pause - Flow control - stepping into code without debug info, stepping one thread, the stepping plan stack,
thread until,thread returnto stub a function,thread jumpand dragging the instruction pointer with the cleanup and ABI limitations,expression -i0to honor breakpoints inside called code - Modifying runtime state - mutate values and properties, call methods, flush Core Animation to see changes while paused, declare
$variables, functions, and types, inject a fix with an auto-continuing breakpoint action, replace a line, stub a return, prototype layout live, and verify the source fix without injected behavior - View debugging - the Xcode view debugger (click-through, clipped content, constraints, creation backtraces, multiple windows, macOS active-state capture), Environment Overrides, console equivalents (
recursiveDescription,_printHierarchy,_autolayoutTrace), the touch-delivery checklist (sendEvent:tracer, hit testing, responder chain, target-action), images and colors via Quick Look or disk, animation slow-down, SwiftUI_printChanges - Watchpoints and memory - watchpoints on variables and on computed ivar addresses with hardware limits, the dirty-plus-compressed footprint model, the memory graph,
vmmap,heap,leaks --traceTree,malloc_history,memory history, Zombies and sanitizers, limits of enabling stack logging mid-session, and jetsam diagnosis - Crashes and symbolication - where reports live, opening
.ips/.crashin Xcode against the project,crashlogin LLDB, UUID matching withdwarfdumpandmdfind,atos -i, ASLR slide, source maps and-debug-prefix-map, a table of exception types and termination codes, catching exceptions and Swift errors live, deadlocks frombt all - Swift debugging - why
vworks whenpofails,swift-healthcheck, module and dSYM pitfalls (static libraries, serialized search paths, stale module cache), static vs dynamic types, optimized code, module-qualified names and mangling,@DebugDescriptionandCustomDebugStringConvertible, concurrency and SwiftUI specifics, Combine debugging operators - Custom commands -
.lldbinitlocations and the per-scheme init file,command aliaswith help and%1,command regexwith dispatch patterns, Python commands with argument parsing and__lldb_init_module, breakpoint callbacks, type summaries, filters, synthetic children, a starter~/.lldbinit - Debugging without source - Mach-O slices, runtime addresses versus file offsets, dyld shared-cache caveats, inherited Objective-C method lookup, and scoped assembly inspection
- Assembly and ABI - arm64 and x86_64 arguments/returns, stack frames, DWARF locations, disassembly, and pointer-authentication limits
- Runtime investigation - blocks, module class dumps, stripped Objective-C stacks, heap instances, singleton storage, cross-references, and scoped Simulator system-process investigations
- Dynamic loading and hooks - a complete C interposition lab,
dlopen/dlsym, saved-IMP swizzling, URLSession observation, and Simulator launch environments - Signing and attach diagnostics - entitlements, profiles, hardened runtime, library validation, and own-app anti-debug checks
- Advanced automation - bundled
adb-lookup,adb-methods,adb-block,vmove, andfviewcommands, allocation histories, remote debugging, DAP/MCP, custom breakpoint resolvers, scripted processes, and thread plans - Tracing - breakpoint tracers, stop hooks, the unified log (
log stream,log show),thread infowith activities, DTrace clause anatomy, theobjc,pid, andsyscallproviders, aggregations, static probes, recursion-aware correlation, process stopping, and bounded memory-change experiments - Playbooks - 18 recipes, including hang sampling and closed-source framework investigation: fix a constant live, test a one-line fix, feed test data, find who changes a label, who dismissed a controller, a tap that does nothing, a value with no setter, stub or skip, reproduce from a crash report, memory growth,
pofailures, Apple code without source, attach instead of rebuild, hot loops, prototype layout, drive LLDB from a terminal - Anti-patterns - the mistakes that burn the most time, grouped by workflow, printing, breakpoints, flow control, UI, memory, crashes, and scripts
You can install this skill into Claude Code, Codex, Gemini, Cursor, and more by using npx:
npx skills add https://github.com/n0an/Apple-Debugging-Agent-Skill --skill apple-debugging
If you get the error npx: command not found, you do not have Node installed. Install it through Homebrew (use Node.js 22.23.4+, 24.22.1+, or 26.12.1+; older releases ship a certificate bundle that is no longer trusted):
brew install node
And if that fails it usually means you need to install Homebrew first.
When using npx, you can select exactly which agents you want to use during the installation. You can also select whether the skill should be installed just for one project, or whether it should be made available for all your projects.
Claude Code:
/plugin install n0an/Apple-Debugging-Agent-Skill
Gemini:
gemini extensions install https://github.com/n0an/Apple-Debugging-Agent-Skill.git --consent
Alternatively, you can clone this whole repository and install it however you want.
The skill is called Apple Debugging, and can be triggered in various ways. For example, in Claude Code you would use this:
/apple-debugging
And in Codex you would use this:
$apple-debugging
In both cases you can provide specific instructions. For example, /apple-debugging the Pay button ignores taps on the checkout screen on Claude, or $apple-debugging here is a crash report, find the cause in Codex.
You can also trigger the skill using natural language:
Use the Apple Debugging skill to find out why the price label shows 0 after refresh.
The skill works in two modes. When the agent has a terminal and the app runs in the Simulator or on the Mac, it attaches with xcrun lldb in batch mode and runs the commands itself. When you are driving Xcode, it gives you exact console commands one step at a time and tells you what to expect. It never attaches a second debugger to a process Xcode already owns.
Agents default to the slowest loop there is: add a print, rebuild, reproduce, read, repeat. They also tend to:
- Use
pofor everything in Swift and give up when the expression evaluator fails, even thoughframe variablewould have answered instantly - Paste a raw address into a Swift expression and conclude the object is gone
- Create a symbolic breakpoint on a method the class never overrides, and wait forever
- Drag the instruction pointer or
thread jumpacross initialization and corrupt the process - Change a view from the console and conclude it did not work because nothing flushed Core Animation
- Symbolicate a crash with a dSYM from a different build
- Set a regex breakpoint across all of UIKit on a device and stall the session
This skill:
- Prefers the live process over a rebuild: mutate, inject, stub, verify, then edit source once and confirm it in a clean run
- Picks the right print command (
v,p,po,expression -l) and the right language context every time - Covers the whole toolbox: breakpoints with actions, watchpoints, the view debugger, the memory graph, crash symbolication, Python commands, DTrace
- Gives recipes, not only commands, for the situations that actually come up
- Knows how an agent should drive LLDB non-interactively: what ends a batch early, how to give a trace a deadline on stock macOS, and what happens to the process when LLDB exits
WWDC sessions behind the material: WWDC18 412 "Advanced Debugging with Xcode and LLDB", WWDC18 416 "iOS Memory Deep Dive", WWDC19 429 "LLDB: Beyond po", WWDC21 10209 "Discover breakpoint improvements", WWDC21 10211 "Symbolication: Beyond the basics", WWDC22 110370 "Debug Swift debugging with LLDB", WWDC24 10198 "Run, Break, Inspect: Explore effective debugging in LLDB".
Contributions are welcome - whether adding new recipes, fixing a command that changed in a newer Xcode, or correcting typos.
- Keep Markdown concise. There is a token cost to using skills, so respect the token budgets of users.
- Do not repeat things LLMs already know. Focus on edge cases, surprises, and common mistakes.
- Validate changed commands on the relevant debugger and platform, and identify examples that have only been checked against documentation.
- All work must be licensed under the MIT license.
Available under the MIT License, which permits commercial use, modification, distribution, and private use.