$npx -y skills add minghinmatthewlam/agent-guards --skill ios-devDevelop iOS apps with a fast simulator-first loop using the xcodebuildmcp CLI: discover project/schemes, build/test/run, capture logs, and triage failures. Use when: (1) normal iOS development, (2) simulator/device build issues, (3) runtime crashes or UI issues, (4) iterative fix
| 1 | # iOS Dev |
| 2 | |
| 3 | ## Goal |
| 4 | Use one skill for day-to-day iOS development and debugging with a single streamlined workflow. |
| 5 | |
| 6 | ## Tooling |
| 7 | `xcodebuildmcp` CLI (installed via Homebrew, zero idle cost — no persistent process). |
| 8 | |
| 9 | All commands follow the pattern: `xcodebuildmcp <workflow> <tool> [--flags]` |
| 10 | |
| 11 | ## Inputs |
| 12 | - Repo root path |
| 13 | - `.xcodeproj` or `.xcworkspace` |
| 14 | - Scheme |
| 15 | - Simulator name or UDID |
| 16 | - Optional device UDID for on-device work |
| 17 | |
| 18 | ## 0) Discovery (always first) |
| 19 | ```bash |
| 20 | xcodebuildmcp simulator discover-projects |
| 21 | xcodebuildmcp simulator list-schemes --project-path ./MyApp.xcodeproj |
| 22 | xcodebuildmcp simulator list |
| 23 | ``` |
| 24 | |
| 25 | ## 1) Configuration |
| 26 | The CLI reads `.xcodebuildmcp/config.yaml` if present. Create one with: |
| 27 | ```bash |
| 28 | xcodebuildmcp setup |
| 29 | ``` |
| 30 | |
| 31 | Or pass explicit flags on every call (recommended for agents — no hidden state): |
| 32 | ``` |
| 33 | --scheme MyApp --project-path ./MyApp.xcodeproj --simulator-name "iPhone 17 Pro" |
| 34 | ``` |
| 35 | |
| 36 | ## 2) Core simulator dev loop |
| 37 | ```bash |
| 38 | # Build only |
| 39 | xcodebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj |
| 40 | |
| 41 | # Run tests |
| 42 | xcodebuildmcp simulator test --scheme MyAppTests --project-path ./MyApp.xcodeproj |
| 43 | |
| 44 | # Build + install + launch (single step) |
| 45 | xcodebuildmcp simulator build-and-run --scheme MyApp --project-path ./MyApp.xcodeproj |
| 46 | ``` |
| 47 | |
| 48 | Useful adjuncts: |
| 49 | ```bash |
| 50 | xcodebuildmcp simulator snapshot-ui --simulator-id <UDID> |
| 51 | xcodebuildmcp simulator screenshot --simulator-id <UDID> |
| 52 | xcodebuildmcp simulator stop --simulator-id <UDID> |
| 53 | ``` |
| 54 | |
| 55 | ## 3) Failure triage loop |
| 56 | ### Build or test failures |
| 57 | 1. Get settings and verify scheme/config: |
| 58 | ```bash |
| 59 | xcodebuildmcp simulator show-build-settings --scheme MyApp --project-path ./MyApp.xcodeproj |
| 60 | ``` |
| 61 | 2. Clean and rebuild: |
| 62 | ```bash |
| 63 | xcodebuildmcp simulator clean --platform "iOS Simulator" |
| 64 | xcodebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj |
| 65 | ``` |
| 66 | 3. Re-run focused tests after fixing. |
| 67 | |
| 68 | ### Runtime crash or behavior issues |
| 69 | 1. Start simulator log capture: |
| 70 | ```bash |
| 71 | xcodebuildmcp logging start-simulator-log-capture --simulator-id <UDID> --bundle-id <BUNDLE_ID> |
| 72 | ``` |
| 73 | 2. Reproduce in app. |
| 74 | 3. Stop capture and inspect output: |
| 75 | ```bash |
| 76 | xcodebuildmcp logging stop-simulator-log-capture --session-id <SESSION_ID> |
| 77 | ``` |
| 78 | 4. Capture UI evidence: |
| 79 | ```bash |
| 80 | xcodebuildmcp simulator snapshot-ui --simulator-id <UDID> |
| 81 | xcodebuildmcp simulator screenshot --simulator-id <UDID> |
| 82 | ``` |
| 83 | |
| 84 | ### Simulator state problems |
| 85 | - Boot/open simulator: |
| 86 | ```bash |
| 87 | xcodebuildmcp simulator open |
| 88 | xcodebuildmcp simulator boot --simulator-name "iPhone 17 Pro" |
| 89 | ``` |
| 90 | - Reset only with user approval (destructive to simulator contents): |
| 91 | ```bash |
| 92 | xcodebuildmcp simulator erase --shutdown-first |
| 93 | ``` |
| 94 | |
| 95 | ## 4) Device builds |
| 96 | Device workflow tools are available via the `device` workflow group: |
| 97 | ```bash |
| 98 | xcodebuildmcp device build --scheme MyApp --project-path ./MyApp.xcodeproj |
| 99 | xcodebuildmcp device build-and-run --scheme MyApp --project-path ./MyApp.xcodeproj |
| 100 | xcodebuildmcp device install --simulator-id <DEVICE_UDID> --app-path ./build/MyApp.app |
| 101 | xcodebuildmcp device launch --device-id <DEVICE_UDID> --bundle-id <BUNDLE_ID> |
| 102 | xcodebuildmcp device test --scheme MyAppTests --project-path ./MyApp.xcodeproj |
| 103 | ``` |
| 104 | |
| 105 | List connected devices: |
| 106 | ```bash |
| 107 | xcodebuildmcp device list |
| 108 | ``` |
| 109 | |
| 110 | ## 5) Other useful commands |
| 111 | ```bash |
| 112 | # LLDB debugging |
| 113 | xcodebuildmcp debugging attach --simulator-id <UDID> --bundle-id <BUNDLE_ID> |
| 114 | xcodebuildmcp debugging add-breakpoint --file MyFile.swift --line 42 |
| 115 | xcodebuildmcp debugging variables |
| 116 | xcodebuildmcp debugging stack |
| 117 | xcodebuildmcp debugging continue |
| 118 | xcodebuildmcp debugging detach |
| 119 | |
| 120 | # Swift packages |
| 121 | xcodebuildmcp swift-package build --package-path ./MyPackage |
| 122 | xcodebuildmcp swift-package test --package-path ./MyPackage |
| 123 | xcodebuildmcp swift-package run --package-path ./MyPackage --target MyTarget |
| 124 | |
| 125 | # Diagnostics |
| 126 | xcodebuildmcp doctor |
| 127 | xcodebuildmcp daemon status |
| 128 | ``` |
| 129 | |
| 130 | ## 6) Output contract for each iteration |
| 131 | Always report: |
| 132 | - failing command and its exit code/output |
| 133 | - error class (`build`, `test`, `runtime`, `simulator`, `signing`) |
| 134 | - key log lines proving root cause |
| 135 | - exact fix applied |
| 136 | - verification command(s) and outcome |
| 137 | |
| 138 | ## Guardrails |
| 139 | - Prefer simulator-first for speed unless device-specific behavior is required. |
| 140 | - Ask before destructive cleanup (`erase`) or actions that remove user data. |
| 141 | - Keep loops short: fix one failure class, re-run, then continue. |
| 142 | - Each CLI command is independent — no session state to manage. |