Back to Skills

xcode-build

verified

Build and run iOS/macOS apps using xcodebuild and xcrun simctl directly. Use when building Xcode projects, running iOS simulators, managing devices, compiling Swift code, running UI tests, or automating iOS app interactions. Replaces XcodeBuildMCP with native CLI tools.

View on GitHub

Marketplace

xcode-build-marketplace

pzep1/xcode-build-skill

Plugin

xcode-build-skill

Repository

pzep1/xcode-build-skill
104stars

/skills/xcode-build/SKILL.md

Last Verified

January 15, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/pzep1/xcode-build-skill/blob/main//skills/xcode-build/SKILL.md -a claude-code --skill xcode-build

Installation paths:

Claude
.claude/skills/xcode-build/
Powered by add-skill CLI

Instructions

# Xcode Build Direct

Build and manage iOS/macOS projects using native Xcode CLI tools instead of MCP servers.

## When to Use This Skill

Use this skill when:
- Building iOS or macOS apps with Xcode
- Running apps in iOS simulators
- Managing simulator instances (boot, shutdown, list)
- Taking screenshots of simulators
- Capturing app logs
- Running tests (unit or UI)
- Automating UI interactions (tap, type, swipe)

**Preference**: Always use direct CLI commands (`xcodebuild`, `xcrun simctl`) instead of XcodeBuildMCP tools.

## Quick Start

### 1. Discover Project Structure
```bash
# List schemes in a workspace
xcodebuild -workspace /path/to/App.xcworkspace -list

# List schemes in a project
xcodebuild -project /path/to/App.xcodeproj -list

# Show build settings
xcodebuild -workspace /path/to/App.xcworkspace -scheme AppScheme -showBuildSettings
```

### 2. Find Available Simulators
```bash
# List all simulators
xcrun simctl list devices

# List as JSON (better for parsing)
xcrun simctl list devices --json

# List only available simulators
xcrun simctl list devices available
```

### 3. Build for Simulator
```bash
# Get simulator UUID first
UDID=$(xcrun simctl list devices --json | jq -r '.devices | .[].[] | select(.name=="iPhone 16 Pro") | .udid' | head -1)

# Build
xcodebuild \
  -workspace /path/to/App.xcworkspace \
  -scheme AppScheme \
  -destination "platform=iOS Simulator,id=$UDID" \
  -configuration Debug \
  -derivedDataPath /tmp/build \
  build
```

### 4. Install and Launch
```bash
# Find the built .app
APP_PATH=$(find /tmp/build -name "*.app" -type d | head -1)

# Install on simulator
xcrun simctl install $UDID "$APP_PATH"

# Launch app
xcrun simctl launch $UDID com.your.bundleid
```

### 5. Take Screenshot
```bash
xcrun simctl io $UDID screenshot /tmp/screenshot.png
```

## Detailed References

For comprehensive command documentation, see:
- **CLI_REFERENCE.md** - Full `xcodebuild` and `xcrun simctl` command reference
- **XCUITEST_GUIDE.md** - UI automa

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
5461 chars