axiom-xcode-debugging
Use when encountering BUILD FAILED, test crashes, simulator hangs, stale builds, zombie xcodebuild processes, "Unable to boot simulator", "No such module" after SPM changes, or mysterious test failures despite no code changes - systematic environment-first diagnostics for iOS/macOS projects
Best use case
axiom-xcode-debugging is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Use when encountering BUILD FAILED, test crashes, simulator hangs, stale builds, zombie xcodebuild processes, "Unable to boot simulator", "No such module" after SPM changes, or mysterious test failures despite no code changes - systematic environment-first diagnostics for iOS/macOS projects
Teams using axiom-xcode-debugging should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/axiom-xcode-debugging/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How axiom-xcode-debugging Compares
| Feature / Agent | axiom-xcode-debugging | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Use when encountering BUILD FAILED, test crashes, simulator hangs, stale builds, zombie xcodebuild processes, "Unable to boot simulator", "No such module" after SPM changes, or mysterious test failures despite no code changes - systematic environment-first diagnostics for iOS/macOS projects
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
SKILL.md Source
# Xcode Debugging ## Overview Check build environment BEFORE debugging code. **Core principle** 80% of "mysterious" Xcode issues are environment problems (stale Derived Data, stuck simulators, zombie processes), not code bugs. ## Example Prompts These are real questions developers ask that this skill is designed to answer: #### 1. "My build is failing with 'BUILD FAILED' but no error details. I haven't changed anything. What's going on?" → The skill shows environment-first diagnostics: check Derived Data, simulator states, and zombie processes before investigating code #### 2. "Tests passed yesterday with no code changes, but now they're failing. This is frustrating. How do I fix this?" → The skill explains stale Derived Data and intermittent failures, shows the 2-5 minute fix (clean Derived Data) #### 3. "My app builds fine but it's running the old code from before my changes. I restarted Xcode but it still happens." → The skill demonstrates that Derived Data caches old builds, shows how deletion forces a clean rebuild #### 4. "The simulator says 'Unable to boot simulator' and I can't run tests. How do I recover?" → The skill covers simulator state diagnosis with simctl and safe recovery patterns (erase/shutdown/reboot) #### 5. "I'm getting 'No such module: SomePackage' errors after updating SPM dependencies. How do I fix this?" → The skill explains SPM caching issues and the clean Derived Data workflow that resolves "phantom" module errors --- ## Red Flags — Check Environment First If you see ANY of these, suspect environment not code: - "It works on my machine but not CI" - "Tests passed yesterday, failing today with no code changes" - "Build succeeds but old code executes" - "Build sometimes succeeds, sometimes fails" (intermittent failures) - "Simulator stuck at splash screen" or "Unable to install app" - Multiple xcodebuild processes (10+) older than 30 minutes ## Mandatory First Steps **ALWAYS run these commands FIRST** (before reading code): ```bash # 1. Check processes (zombie xcodebuild?) ps aux | grep -E "xcodebuild|Simulator" | grep -v grep # 2. Check Derived Data size (>10GB = stale) du -sh ~/Library/Developer/Xcode/DerivedData # 3. Check simulator states (stuck Booting?) xcrun simctl list devices | grep -E "Booted|Booting|Shutting Down" ``` #### What these tell you - **0 processes + small Derived Data + no booted sims** → Environment clean, investigate code - **10+ processes OR >10GB Derived Data OR simulators stuck** → Environment problem, clean first - **Stale code executing OR intermittent failures** → Clean Derived Data regardless of size #### Why environment first - Environment cleanup: 2-5 minutes → problem solved - Code debugging for environment issues: 30-120 minutes → wasted time ## Quick Fix Workflow ### Finding Your Scheme Name If you don't know your scheme name: ```bash # List available schemes xcodebuild -list ``` ### For Stale Builds / "No such module" Errors ```bash # Clean everything xcodebuild clean -scheme YourScheme rm -rf ~/Library/Developer/Xcode/DerivedData/* rm -rf .build/ build/ # Rebuild xcodebuild build -scheme YourScheme \ -destination 'platform=iOS Simulator,name=iPhone 16' ``` ### For Simulator Issues ```bash # Shutdown all simulators xcrun simctl shutdown all # If simctl command fails, shutdown and retry xcrun simctl shutdown all xcrun simctl list devices # If still stuck, erase specific simulator xcrun simctl erase <device-uuid> # Nuclear option: force-quit Simulator.app killall -9 Simulator ``` ### For Zombie Processes ```bash # Kill all xcodebuild (use cautiously) killall -9 xcodebuild # Check they're gone ps aux | grep xcodebuild | grep -v grep ``` ### For Test Failures ```bash # Isolate failing test xcodebuild test -scheme YourScheme \ -destination 'platform=iOS Simulator,name=iPhone 16' \ -only-testing:YourTests/SpecificTestClass ``` ## Simulator Verification (Optional) After applying fixes, verify in simulator with visual confirmation. ### Quick Screenshot Verification ```bash # 1. Boot simulator (if not already) xcrun simctl boot "iPhone 16 Pro" # 2. Build and install app xcodebuild build -scheme YourScheme \ -destination 'platform=iOS Simulator,name=iPhone 16 Pro' # 3. Launch app xcrun simctl launch booted com.your.bundleid # 4. Wait for UI to stabilize sleep 2 # 5. Capture screenshot xcrun simctl io booted screenshot /tmp/verify-build-$(date +%s).png ``` ### Using Axiom Tools **Quick screenshot**: ```bash /axiom:screenshot ``` **Full simulator testing** (with navigation, state setup): ```bash /axiom:test-simulator ``` ### When to Use Simulator Verification Use when: - **Visual fixes** — Layout changes, UI updates, styling tweaks - **State-dependent bugs** — "Only happens in this specific screen" - **Intermittent failures** — Need to reproduce specific conditions - **Before shipping** — Final verification that fix actually works **Pro tip**: If you have debug deep links (see `axiom-deep-link-debugging` skill), you can navigate directly to the screen that was broken: ```bash xcrun simctl openurl booted "debug://problem-screen" sleep 1 xcrun simctl io booted screenshot /tmp/fix-verification.png ``` ## Decision Tree ``` Test/build failing? ├─ BUILD FAILED with no details? │ └─ Clean Derived Data → rebuild ├─ Build intermittent (sometimes succeeds/fails)? │ └─ Clean Derived Data → rebuild ├─ Build succeeds but old code executes? │ └─ Delete Derived Data → rebuild (2-5 min fix) ├─ "Unable to boot simulator"? │ └─ xcrun simctl shutdown all → erase simulator ├─ "No such module PackageName"? │ └─ Clean + delete Derived Data → rebuild ├─ Tests hang indefinitely? │ └─ Check simctl list → reboot simulator ├─ Tests crash? │ └─ Check ~/Library/Logs/DiagnosticReports/*.crash └─ Code logic bug? └─ Use systematic-debugging skill instead ``` ## Common Error Patterns | Error | Fix | |-------|-----| | `BUILD FAILED` (no details) | Delete Derived Data | | `Unable to boot simulator` | `xcrun simctl erase <uuid>` | | `No such module` | Clean + delete Derived Data | | Tests hang | Check simctl list, reboot simulator | | Stale code executing | Delete Derived Data | ## Useful Flags ```bash # Show build settings xcodebuild -showBuildSettings -scheme YourScheme # List schemes/targets xcodebuild -list # Verbose output xcodebuild -verbose build -scheme YourScheme # Build without testing (faster) xcodebuild build-for-testing -scheme YourScheme xcodebuild test-without-building -scheme YourScheme ``` ## Crash Log Analysis ```bash # Recent crashes ls -lt ~/Library/Logs/DiagnosticReports/*.crash | head -5 # Symbolicate address (if you have .dSYM) atos -o YourApp.app.dSYM/Contents/Resources/DWARF/YourApp \ -arch arm64 0x<address> ``` ## Common Mistakes ❌ **Debugging code before checking environment** — Always run mandatory steps first ❌ **Ignoring simulator states** — "Booting" can hang 10+ minutes, shutdown/reboot immediately ❌ **Assuming git changes caused the problem** — Derived Data caches old builds despite code changes ❌ **Running full test suite when one test fails** — Use `-only-testing` to isolate ## Real-World Impact **Before** 30+ min debugging "why is old code running" **After** 2 min environment check → clean Derived Data → problem solved **Key insight** Check environment first, debug code second.
Related Skills
electric-debugging
Troubleshoot Electric sync issues. Covers fast-loop detection from CDN/proxy cache key misconfiguration, stale cache diagnosis (StaleCacheError), MissingHeadersError from CORS misconfiguration, 409 shape expired handling, SSE proxy buffering (nginx proxy_buffering off, Caddy flush_interval -1), HTTP/1.1 6-connection limit in local dev (Caddy HTTP/2 proxy), WAL growth from replication slots (max_slot_wal_keep_size), Vercel CDN cache issues, and onError/backoff behavior. Load when shapes are not receiving updates, sync is slow, or errors appear in the console.
error-debugging-multi-agent-review
Use when working with error debugging multi agent review
error-debugging-error-trace
You are an error tracking and observability expert specializing in implementing comprehensive error monitoring solutions. Set up error tracking systems, configure alerts, implement structured logging, and ensure teams can quickly identify and resolve production issues.
error-debugging-error-analysis
You are an expert error analysis specialist with deep expertise in debugging distributed systems, analyzing production incidents, and implementing comprehensive observability solutions.
debugging-toolkit-smart-debug
Use when working with debugging toolkit smart debug
debugging-strategies
Master systematic debugging techniques, profiling tools, and root cause analysis to efficiently track down bugs across any codebase or technology stack. Use when investigating bugs, performance issues, or unexpected behavior.
when-debugging-ml-training-use-ml-training-debugger
Debug ML training issues and optimize performance including loss divergence, overfitting, and slow convergence
when-debugging-code-use-debugging-assistant
Intelligent debugging workflow that systematically identifies symptoms, performs root cause analysis, generates fixes with explanations, validates solutions, and prevents regressions through compre...
flow-debugging
4-phase systematic debugging for flow-fix. NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
axiom-audit
Audit Axiom logs to identify and prioritize errors and warnings, research probable causes, and flag log smells. Use when user asks to check Axiom logs, analyze production errors, investigate log issues, or audit logging patterns.
chrome-devtools-debugging
Debug and analyze web applications using Chrome DevTools MCP. Use for console log inspection, network request monitoring, performance analysis, and debugging authenticated sessions. For basic browser automation (screenshots, form filling), use browser-discovery skill instead.
neovim-debugging
Debug Neovim/LazyVim configuration issues. Use when: user reports Neovim errors, keymaps not working, plugins failing, or config problems. Provides systematic diagnosis through hypothesis testing, not just checklists. Think like a detective narrowing down possibilities.