Verify AI-generated iOS code actually builds and runs on a simulator
When to use: Claude just wrote or edited SwiftUI views. Before saying 'done', you want to compile, run on simulator, and screenshot.
Prerequisites
- Xcode installed — Xcode 15+ from the Mac App Store; confirm with
xcodebuild -version - A bootable simulator — Xcode → Settings → Platforms → iOS Simulator downloaded
Flow
-
Discover the project and buildFind the Xcode project in /Users/me/Projects/MyApp. Build scheme 'MyApp' for iOS Simulator destination 'iPhone 16'. Report any errors or warnings.✓ Copied→ Build succeeds, or specific errors with file:line
-
Boot simulator, install, launchBoot an iPhone 16 simulator if not already booted. Install the built app and launch it. Take a screenshot after 3 seconds.✓ Copied→ App running; screenshot captured
-
Drive the featureTap the 'Sign Up' button, type '[email protected]' in the email field, tap Submit. Screenshot after each step.✓ Copied→ Sequence of screenshots showing the flow; or a clear tap-failed error
Outcome: Before/after screenshots that prove the feature works, committed alongside the code.
Pitfalls
- Tapping by coordinate is fragile across device sizes — Prefer accessibility-label based taps when the MCP supports them; use coordinates only as fallback
- Simulator build uses a different architecture than a real device — For architecture-sensitive code, also build for a physical device at least once before merging