ABOUTME: XcodeBuildMCP integration for building, running, and debugging iOS apps via CLI
ABOUTME: Simulator control, UI interaction, log capture, screenshot automation
iOS Debugger
When to Invoke
- Build/run iOS apps without Xcode UI
- Automate simulator interactions
- Capture app logs programmatically
- UI testing via CLI
- CI/CD iOS workflows
Capabilities
- Build and run on booted simulator
- Interact with simulator UI (tap, type, gestures)
- Capture and filter app logs
- Take screenshots
- Install/uninstall apps
Prerequisites
xcrun simctl list devices | grep Booted
xcrun simctl boot "iPhone 16 Pro"
Build and Run
xcodebuild -workspace MyApp.xcworkspace \
-scheme MyApp \
-sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
build
xcrun simctl install booted path/to/MyApp.app
xcrun simctl launch booted com.example.myapp
UI Interaction
xcrun simctl io booted tap 200 400
xcrun simctl io booted type "Hello World"
xcrun simctl io booted swipe 200 600 200 200 0.5
xcrun simctl io booted screenshot screenshot.png
Log Capture
xcrun simctl spawn booted log stream --predicate 'processImagePath CONTAINS "MyApp"'
xcrun simctl spawn booted log stream --predicate 'subsystem == "com.example.myapp"'
xcrun simctl spawn booted log stream \
--predicate 'processImagePath CONTAINS "MyApp"' \
> app.log &
Common Workflows
Reset Simulator
xcrun simctl erase "iPhone 16 Pro"
xcrun simctl shutdown "iPhone 16 Pro"
xcrun simctl boot "iPhone 16 Pro"
Tips
- Always check simulator is booted before commands
- Use
log stream predicates to filter noise
- Coordinate-based taps are fragile (prefer accessibility IDs in XCTest)
- Capture screenshots for visual regression tests
- Use
xcrun simctl openurl to test deep links
Integration with Tests
xcodebuild test \
-workspace App.xcworkspace \
-scheme App \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
-resultBundlePath TestResults.xcresult