CodeepCodeep
← back to marketplace

xcode-build

v1.0.0

Build an Xcode scheme with xcodebuild, surface compile/link errors, fix the source, and re-run until BUILD SUCCEEDED. Use when asked to build, compile, or fix build errors in a macOS/iOS Xcode project, or to verify Swift/Obj-C changes compile.

by VladoIvankovic · 0 installs · updated 6/16/2026

Install

/skills install VladoIvankovic/xcode-build

Runs in any Codeep session (TUI, Zed, or VS Code extension). Writes to .codeep/skills/xcode-build/SKILL.md in your project.

SKILL.md

---
name: xcode-build
description: Build an Xcode scheme with xcodebuild, surface compile/link errors, fix the source, and re-run until BUILD SUCCEEDED. Use when asked to build, compile, or fix build errors in a macOS/iOS Xcode project, or to verify Swift/Obj-C changes compile.
allowed-tools: [execute_command, read_file, edit_file, search_code, list_files]
triggers: ["build the xcode project", "fix build errors", "does it compile", "xcodebuild", "build the app", "compile the scheme"]
version: 1.0.0
author: Codeep
---

# Xcode Build

Build an Xcode target, read the failures, fix the source, and loop until the build is clean. macOS + Xcode only.

## Discover the build target
1. Find the project: `list_files` the repo root for a `*.xcworkspace` or `*.xcodeproj`. Prefer the workspace if both exist (CocoaPods/SPM setups need it).
2. List schemes — workspace: `xcodebuild -workspace <name>.xcworkspace -list` ; project: `xcodebuild -project <name>.xcodeproj -list`. Pick the scheme the user named, else the one matching the app/product name.

## Build
Run via `execute_command` (workspace form shown; swap `-workspace <w>` for `-project <p>` if there's no workspace):

```
xcodebuild -workspace <name>.xcworkspace -scheme <scheme> -configuration Debug CODE_SIGNING_ALLOWED=NO build 2>&1 | tail -n 120
```

- `CODE_SIGNING_ALLOWED=NO` avoids signing/provisioning prompts for CI-style local builds. Drop it only if the user needs a signed build.
- Pipe through `tail` so the final status and errors aren't lost in noise. If you need more, re-run without the pipe or use a larger `-n`.
- For an iOS scheme that won't build for "Any Device", add a simulator destination: `-destination 'generic/platform=iOS Simulator'`.

## Triage failures
- Scan output for `error:` lines and the trailing `** BUILD FAILED **`. Each Swift/Clang `error:` carries `path:line:col: error: message` — that's your jump target.
- Open the offending file with `read_file` around the reported line. Use `search_code` to trace symbols (missing type, renamed API, wrong signature) across the project.
- Fix the cause with `edit_file`. Common cases: typos/renamed symbols, missing `import`, optional unwrapping, protocol conformance gaps, mismatched argument labels, files not added to the target.
- Ignore `warning:` lines unless they block the build or the user asked to clean them.

## Loop
Re-run the exact build command after each fix. Repeat triage → fix → build until you see `** BUILD SUCCEEDED **`. If the same error survives two fixes, re-read the full surrounding context before trying again — don't guess-edit.

## On failure
- "scheme not found" → re-run `-list`; the scheme name is case-sensitive.
- Signing/provisioning errors despite the flag → confirm `CODE_SIGNING_ALLOWED=NO` is on the `build` invocation, not a separate line.
- Stale or phantom errors → `xcodebuild ... clean` once, then build again.
- Toolchain missing → `xcodebuild -version`; if it errors, run `xcode-select -p` and tell the user Xcode/CLT setup is required (do not try to install it).

## Done when
`** BUILD SUCCEEDED **` appears and no `error:` lines remain in the output. Report the scheme/configuration built and any source files you changed.