mcp-xcode
Build and test iOS apps with Xcode. Use when building projects, running tests, checking errors, getting build logs, listing schemes, clean builds, archiving apps.
When & Why to Use This Skill
This Claude skill integrates Xcode's powerful build and test capabilities directly into the AI workflow, enabling seamless iOS and macOS application development. It automates core development tasks including project building, unit/UI testing, scheme management, and build log analysis, allowing developers to identify and resolve compilation errors or test failures through natural language interaction.
Use Cases
- Automated Build & Debugging: Trigger project builds after code modifications and allow the agent to automatically parse error logs, identify syntax issues, and suggest or apply fixes.
- Continuous Testing & QA: Execute specific test plans or individual test cases to validate new features and ensure no regressions are introduced before code commits.
- Project Environment Management: Quickly list and switch between different project schemes and build configurations (Debug vs. Release) to verify app behavior across different environments.
- Pre-commit Validation Workflow: Perform a comprehensive 'clean build' followed by a full test suite execution to maintain high code quality and ensure the repository remains in a deployable state.
| name | mcp-xcode |
|---|---|
| description | Build and test iOS apps with Xcode. Use when building projects, running tests, checking errors, getting build logs, listing schemes, clean builds, archiving apps. |
| allowed-tools | Read, MCP, Bash |
Xcode MCP Integration
Table of Contents
1. MCP Tools
xcode_list_schemes
List all schemes in project.
- Input: None (auto-detect)
- Output: Scheme list, default scheme
- Use: First setup, before build
xcode_build
Build project or workspace.
- Input: scheme (required), configuration (Debug/Release), clean (true/false)
- Output: Build status, errors, warnings, build time
- Use: After implementing tasks, before commit
xcode_test
Run unit and UI tests.
- Input: scheme (required), testPlan (optional), only (specific test)
- Output: Test results, failed details, coverage
- Use: After writing tests, before commit
xcode_clean
Clean build folder.
- Input: scheme (required)
- Output: Clean status
- Use: Unclear build errors, after dependency changes
xcode_get_build_settings
Get project build settings.
- Input: scheme, configuration
- Output: All build settings
- Use: Debug build issues
2. Workflows
Setup Project (First Time)
xcode_list_schemes→ Save scheme namexcode_buildwith scheme, Debug config- Fix errors if any
After Task Implementation
xcode_buildwith scheme- Success → Continue
- Failed → Fix errors → Rebuild
After Phase Completion
xcode_cleanxcode_buildwith clean: truexcode_test- All pass → git commit
Pre-Commit
- xcode_clean
- xcode_build (clean: true)
- xcode_test
- All pass → commit
3. Error Handling
Common Build Errors
| Error | Fix |
|---|---|
| Syntax error | Read file, fix syntax |
| Type mismatch | Check types, convert if needed |
| Missing import | Add import statement |
| Unresolved identifier | Check declaration, DI |
Common Test Errors
| Error | Fix |
|---|---|
| Test timeout | Increase timeout or check async |
| Assertion failed | Check logic, update test/code |
| Missing test target | Check scheme includes tests |
4. Build Configurations
Debug vs Release
| Setting | Debug | Release |
|---|---|---|
| Optimization | None | Aggressive |
| Debug Symbols | Yes | No |
| Build Time | Fast | Slow |
| App Size | Large | Small |
Destinations
- Simulator:
platform=iOS Simulator,name=iPhone 15 Pro - Device:
platform=iOS,id=[UDID] - Generic:
generic/platform=iOS
5. Checklist
Each Build
- Correct scheme name
- Appropriate configuration
- Read errors if any
- Fix errors top to bottom
Each Test Run
- Build passes first
- Scheme includes test targets
- Read failed test details
Pre-Commit
- Clean build
- All tests pass
- No warnings (or acceptable)