Version: 1.4.0 Last Updated: 2025-10-14 FOR AI ASSISTANTS: This is your quick reference for macOS, iPadOS, and visionOS development commands. Use these exact phrases when helping users build Apple apps across all platforms.
XcodeBuildMCP provides automated Xcode operations through natural language for:
- 🖥️ macOS - Native Mac apps
- 📱 iPadOS - iPad apps (via iOS simulator/device tools)
- 🥽 visionOS - Apple Vision Pro apps
You have access to 86 tools for building, testing, and debugging across all Apple platforms.
"What Xcode projects are in this directory?"
"List available schemes for my project"
What it does:
discover_projs()- Finds all.xcodeprojand.xcworkspacefileslist_schemes()- Shows all build schemes in a project
"Show me the build settings for my project"
What it does: show_build_settings() - Displays complete Xcode build configuration
"Clean my project build artifacts"
What it does: clean() - Removes derived data and build products
"What's the bundle ID for this app?"
What it does:
get_app_bundle_id()- For iOS/visionOS appsget_mac_bundle_id()- For macOS apps
XcodeBuildMCP supports session defaults to reduce repetitive parameters. Set common values once, then use any tool with minimal parameters.
// Step 1: Set defaults once
session-set-defaults({
projectPath: "/Users/dale/Projects/orchestrator/orchestrator.xcodeproj",
scheme: "orchestrator",
configuration: "Debug",
simulatorId: "IPHONE_16_UUID" // Optional: Get from list_sims()
})
// Step 2: Use tools with minimal parameters
build_sim({ platform: "iOS Simulator" }) // Uses session defaults
test_sim({ simulatorName: "iPad Pro" }) // Overrides simulatorId
build_run_sim({}) // Uses all session defaults
// Step 3: Override when needed
test_sim({
scheme: "orchestrator-unit-tests", // Override for this call only
simulatorName: "iPhone 16"
})| Tool | Purpose |
|---|---|
session-set-defaults(params) |
Set or update defaults (preserves unspecified values) |
session-show-defaults() |
View current defaults |
session-clear-defaults() |
Clear all defaults |
session-clear-defaults({ keys: ["scheme"] }) |
Clear specific defaults |
| Parameter | Type | Description |
|---|---|---|
projectPath |
string | Path to .xcodeproj (XOR with workspacePath) |
workspacePath |
string | Path to .xcworkspace (XOR with projectPath) |
scheme |
string | Xcode scheme name (required for most operations) |
configuration |
string | "Debug" (default) or "Release" |
simulatorName |
string | Simulator name (e.g., "iPhone 16", "iPad Pro") |
simulatorId |
string | Simulator UUID (XOR with simulatorName) |
deviceId |
string | Physical device UDID |
platform |
string | "iOS Simulator", "visionOS Simulator", etc. |
Missing scheme:
session-set-defaults({ scheme: "MyScheme" })
// or provide explicitly: test_sim({ scheme: "MyScheme", projectPath: "..." })Mutually exclusive parameters (projectPath/workspacePath or simulatorId/simulatorName):
session-clear-defaults({ keys: ["projectPath", "workspacePath"] })
session-set-defaults({ workspacePath: "/path/to/MyApp.xcworkspace" })Correct Workflow: Use session defaults + platform parameter:
Step 1: Set Session Defaults (once per project)
session-set-defaults({
projectPath: "/path/to/your-project/your-project.xcodeproj",
scheme: "your-scheme-name",
simulatorId: "YOUR_SIMULATOR_UUID" // Get from list_sims()
})Step 2: Build with Platform Parameter
build_sim({ platform: "visionOS Simulator" })Verified Working:
- ✅ groovetech-media-player: Build succeeded (tested 2025-10-10 17:21)
- ✅ PfizerOutdoCancerV2: Build succeeded (tested 2025-10-10 17:22)
- ✅ orchestrator (iPad): Build succeeded, session-management workflow works (tested 2025-10-12 14:47)
- ❌ orchestrator (macOS): Build fails with compilation error in AppUIModel.swift:1534 (tested 2025-10-13 09:22)
Key Point: The platform parameter is REQUIRED for visionOS. Without it, defaults to iOS Simulator.
"List all available visionOS simulators"
"Show me Vision Pro simulators"
What it does: Calls list_sims() - Shows Apple Vision Pro simulators with UUIDs, xrOS versions, and boot states.
"Build my app for the Vision Pro simulator"
What happens:
- Calls
build_sim()with your scheme - Builds for
visionOS Simulatorplatform - Returns build logs
"Build and run my app on the Apple Vision Pro simulator"
Full workflow:
build_sim()- Compile for visionOSboot_sim()- Boot simulator if neededinstall_app_sim()- Install .app bundlelaunch_app_sim()- Launch app
"Show me connected Vision Pro devices"
"Build my app for my Vision Pro headset"
"Install and launch on the Vision Pro"
Tools used:
list_devices()- Detect physical Vision Pro (platform: "visionOS")build_device()- Build withplatform: "visionOS"install_app_device()- Install to headsetlaunch_app_device()- Launch app
"Start capturing logs from my Vision Pro headset"
[User reproduces issue]
"Stop log capture and show me what happened"
What happens:
start_device_log_cap({ deviceId: "...", bundleId: "..." })- Returns asessionId- SAVE THE SESSION ID - You'll need it for stop
- User reproduces issue on headset
stop_device_log_cap({ logSessionId: "SESSION_ID_FROM_STEP_1" })- Returns complete logs- AI analyzes logs directly
Why this matters: No more copy-pasting logs from Console.app!
start_device_log_cap() and get a session ID. Don't just SAY you started capture - actually call the tool! See the "Log Capture Troubleshooting" section below for common failures.
"Capture logs from the Vision Pro simulator"
Same workflow using start_sim_log_cap() and stop_sim_log_cap().
Same rules apply:
- Call
start_sim_log_cap()- get session ID - Save the session ID
- Call
stop_sim_log_cap({ logSessionId: "..." })with EXACT session ID
iPadOS uses the same tools as iOS - just specify iPad simulators or devices.
"List available iPad simulators"
"Show me iPad Pro simulators"
What it does: list_sims() - Shows all simulators including iPad variants (Air, Pro, Mini)
"Build my app for iPad Pro simulator"
What happens:
build_sim({ simulatorName: "iPad Pro", ... })- Same workflow as iPhone/visionOS
"Build and run on iPad Air simulator"
Full workflow: Same as visionOS - build → boot → install → launch
"Show me connected iPads"
"Build my app for my iPad"
"Install and launch on the iPad"
Tools used:
list_devices()- Shows connected iPads (platform: "iOS")build_device()- Build for physical iPadinstall_app_device()- Install to iPadlaunch_app_device()- Launch app
"Start capturing logs from my iPad"
[User reproduces issue]
"Stop log capture and show me the logs"
Same workflow as Vision Pro:
start_device_log_cap()for physical iPad - get and save session IDstart_sim_log_cap()for iPad simulator - get and save session ID- Use the EXACT session ID when calling stop
"Build my macOS app"
What happens:
build_macos({ projectPath: "...", scheme: "..." })- Compiles for macOS native
- Returns build results
"Build and run my Mac app"
What happens:
build_run_macos()- Builds and launches in one step- App launches on your Mac
"Launch my Mac app"
What happens:
launch_mac_app({ appPath: "/path/to/app.app" })- Launches .app bundle
"Stop my running Mac app"
What happens:
stop_mac_app({ appName: "MyApp" })- Terminates by name- Or by PID:
stop_mac_app({ processId: 12345 })
"Run my macOS test suite"
What happens:
test_macos({ projectPath: "...", scheme: "..." })- Runs XCTest suite
"Where is my built Mac app?"
What happens:
get_mac_app_path()- Returns path to compiled .app bundle
"Run tests on the [iPad Pro / Vision Pro / iPhone] simulator"
What happens:
test_sim()- Runs XCTest suite on simulator- Works for iOS, iPadOS, visionOS simulators
"Run tests on my [iPad / Vision Pro / iPhone]"
What happens:
test_device({ platform: "iOS" })- For iPad/iPhonetest_device({ platform: "visionOS" })- For Vision Pro
"Run my macOS tests"
What happens:
test_macos()- Runs native Mac tests
"Show me the UI hierarchy"
"Get coordinates for UI elements"
What it does: describe_ui() - Returns complete view hierarchy with exact (x, y, width, height) for all elements
CRITICAL: Always call describe_ui() before UI interactions. Never guess coordinates from screenshots!
"Tap the button at coordinates (200, 300)"
"Swipe from (100, 200) to (100, 500)"
"Type 'Hello World' into the text field"
"Take a screenshot"
Tools used:
tap()- Tap at precise coordinatesswipe()- Swipe gestureslong_press()- Long press at coordinatestype_text()- Keyboard inputscreenshot()- Visual capturebutton()- Hardware buttons (home, lock, side-button)gesture()- Preset gestures (scroll-up, swipe-from-edge)
Works on: iOS, iPadOS, visionOS simulators only (not physical devices)
| Natural Language | Tool Called | Platforms |
|---|---|---|
| "List simulators" | list_sims() |
iOS, iPadOS, visionOS |
| "Boot simulator" | boot_sim() |
All simulator platforms |
| "Build for simulator" | build_sim() |
All simulator platforms |
| "Install on simulator" | install_app_sim() |
All simulator platforms |
| "Launch on simulator" | launch_app_sim() |
All simulator platforms |
| "Run tests on simulator" | test_sim() |
All simulator platforms |
| "Stop app on simulator" | stop_app_sim() |
All simulator platforms |
| "Capture simulator logs" | start_sim_log_cap() + stop_sim_log_cap() |
All simulator platforms |
| Natural Language | Tool Called | Platforms |
|---|---|---|
| "Show connected devices" | list_devices() |
iOS, iPadOS, visionOS |
| "Build for device" | build_device() |
All physical device platforms |
| "Install on device" | install_app_device() |
All physical device platforms |
| "Launch on device" | launch_app_device() |
All physical device platforms |
| "Run tests on device" | test_device() |
All physical device platforms |
| "Stop app on device" | stop_app_device() |
All physical device platforms |
| "Capture device logs" | start_device_log_cap() + stop_device_log_cap() |
All physical device platforms |
| Natural Language | Tool Called | Purpose |
|---|---|---|
| "Build Mac app" | build_macos() |
Compile macOS app |
| "Build and run Mac app" | build_run_macos() |
Build + launch in one step |
| "Launch Mac app" | launch_mac_app() |
Launch existing .app |
| "Stop Mac app" | stop_mac_app() |
Terminate running app |
| "Run Mac tests" | test_macos() |
Execute XCTest suite |
| "Get Mac app path" | get_mac_app_path() |
Find built .app location |
"I'll use xcodebuild command to build your project"
"Let me run xcodebuild -scheme MyScheme..."
Why it's wrong: You have XcodeBuildMCP tools! Never fall back to raw CLI commands.
"I'll build your [visionOS/iPad/Mac] app using XcodeBuildMCP"
[Calls appropriate build_sim() / build_device() / build_macos() automatically]
Root Cause: Agent says "I've started log capture" without actually calling start_device_log_cap(), then fails when calling stop because no session ID exists.
// Step 1: ACTUALLY call start tool
start_device_log_cap({ deviceId: "...", bundleId: "..." })
// Returns: { sessionId: "abc-123-def" }
// Step 2: Save the session ID and confirm
"✅ Log capture started (Session: abc-123-def). Please reproduce the issue."
// Step 3: User reproduces issue
// Step 4: Call stop with EXACT session ID
stop_device_log_cap({ logSessionId: "abc-123-def" })
// Returns: { logs: "actual log contents..." }1. Agent never calls start tool
- ❌ Agent says: "I've started capturing logs"
- ✅ Must call:
start_device_log_cap()and receive session ID
2. Agent loses or forgets session ID
- ❌ Agent calls:
stop_device_log_cap({ logSessionId: undefined }) - ✅ Must use: EXACT session ID from start call
Before calling stop:
- Did you ACTUALLY call
start_device_log_cap()orstart_sim_log_cap()? - Did you receive and SAVE the
sessionId? - Are you using the EXACT session ID in stop call?
- Did you match device/simulator tool types (don't mix device and sim tools)?
iPad Simulator: Build + run workflow
[list_sims()] → [build_sim()] → [boot_sim()] → [install_app_sim()] → [launch_app_sim()]macOS App: Single-command build and launch
[build_run_macos()] // Builds and launches in one stepVision Pro Debugging: Log capture workflow
[start_device_log_cap()] → User reproduces issue → [stop_device_log_cap()] → Analyze logsCross-Platform: Parallel builds
[build_macos()] + [build_sim(iPad)] + [build_sim(Vision Pro)]- Always use XcodeBuildMCP tools - Never fall back to raw xcodebuild/xcrun commands
- Platform detection from context - Keywords like "iPad", "Mac", "Vision Pro" tell you which tools to use
- Simulator vs Device - Simulator tools for testing, device tools for physical hardware
- macOS is different - Uses dedicated
build_macos(),launch_mac_app(), etc. - Log capture is autonomous - Start → User reproduces → Stop → Analyze
- UI automation simulator-only -
describe_ui(),tap(), etc. don't work on physical devices - Full workflow automation - Build → Install → Launch can happen in one user request
- Code signing required - Physical devices need valid provisioning profiles
Users must have XcodeBuildMCP configured in their AI client.
Configuration Locations:
| AI Tool | Config File | Status |
|---|---|---|
| Claude Code | ~/.claude.json |
✅ Using local build |
| Cursor | ~/.cursor/mcp.json |
✅ Using local build |
| Claude Desktop | ~/.config/claude/mcp.json |
✅ Using local build |
| Factory Droid | ~/.factory/mcp.json |
✅ Using local build |
For detailed configuration instructions, see: @MCP_CONFIG_LOCATIONS.md
Current Configuration (using local build):
{
"XcodeBuildMCP": {
"command": "node",
"args": [
"/path/to/XcodeBuildMCP/build/index.js"
],
"env": {}
}
}If user reports "command not found": → They need to configure MCP server (see MCP_CONFIG_LOCATIONS.md)
For most workflows, the session-management workflow MUST be enabled:
"XCODEBUILDMCP_ENABLED_WORKFLOWS": "simulator,device,logging,project-discovery,ui-testing,session-management"Why it's required:
- Many tools depend on session defaults (projectPath, scheme, simulatorId, etc.)
- Without this workflow,
build_sim(),test_sim(), etc. will fail with "Missing required session defaults" - The session tools (
session-set-defaults,session-clear-defaults,session-show-defaults) are only available when this workflow is enabled
build_sim() without setting session defaults first, causing cryptic errors.
Correct Pattern:
// Step 1: Set session defaults (once per project)
session-set-defaults({
projectPath: "/path/to/your-project/your-project.xcodeproj",
scheme: "your-scheme-name",
simulatorId: "YOUR_SIMULATOR_UUID" // Get from list_sims()
})
// Step 2: Build with simplified calls
build_sim({ platform: "iOS Simulator" })For complete details:
- AVP_WORKFLOW_GUIDE.md - visionOS workflows
- docs/TOOLS.md - All 86 tools documented
- docs/ARCHITECTURE.md - How it works
Last Tested: 2025-10-12 | Environment: macOS + Xcode 16.x
| Platform | Simulator Build | Simulator Log | macOS Launch | Status |
|---|---|---|---|---|
| iPadOS | ✅ WORKS | ✅ WORKS | N/A | Fully tested |
| macOS | N/A | N/A | ✅ WORKS | Fully tested |
| visionOS | ✅ WORKS (v1.2.0+) | 📋 Not tested | N/A | Build verified |
| iOS | ✅ WORKS | 📋 Not tested | N/A | Same as iPad |
Legend: ✅ Tested | ❌ Broken | 📋 Not tested | N/A - Not applicable
✅ FIXED in v1.2.0: visionOS builds now work with platform: "visionOS Simulator" parameter
start_device_log_cap() or lose session IDs (see troubleshooting section)
If commands fail:
- Run doctor:
npx --package xcodebuildmcp@latest xcodebuildmcp-doctor - Verify MCP configuration
- For visionOS: Use v1.2.0+ with
platformparameter