How to Build iOS & macOS Apps in VS Code (Cursor/Windsurf) with Claude Code & SweetPad

How to Build iOS & macOS Apps in VS Code (Cursor/Windsurf) with Claude Code & SweetPad

I wanted to use Cursor/VS Code with Claude Code so I could get LLM power inside my editor and build apps the way I do for Python and web stuff.

But iPhone (and Mac) development requires Xcode, and Xcode doesn’t have built-in support for LLM help (yet). I’d heard people were doing this with Cursor and Xcode, but I wasn’t sure how.

Here’s how I got it working, plus a bonus on theming VS Code to look like Xcode.

This setup includes

  • Homebrew tools: xcode-build-server, xcbeautify, and swiftformat
  • SweetPad extension for VS Code to bridge to Xcode’s CLI
  • Claude Code inside VS Code (or any fork like Cursor, Windsurf, etc.) for LLM-assisted coding
  • Bonus theme: Xcode 12 color scheme for a familiar look

Setting up VS Code to talk to XCode

Step 1: Ensure Xcode is installed and set up

  • Download Xcode from the App Store
  • Open Xcode once to accept the license and install command-line tools

Step 2: Install required tools via Homebrew:

# Builds your projects without needing Xcode open
brew install xcode-build-server

# Pretty prints the xcodebuild command output into Cursor's terminal
brew install xcbeautify

# Allows for advanced formatting and language features
brew install swiftformat

Step 3: Install SweetPad extension in Cursor

  1. Open Cursor
  2. Go to Extensions
  3. Search for and install “SweetPad”
  4. Link: https://marketplace.visualstudio.com/items?itemName=swiftlang.swift-vscode

Step 4: Create your initial iOS app in Xcode

  1. Open Xcode
  2. Create a new iOS app project with SwiftUI
  3. Save the project and close Xcode

Step 5: Open project in Cursor and configure

  1. Open the .xcodeproj file in Cursor
  2. Press CMD+SHIFT+P and run SweetPad: Generate Build Server Config (buildServer.json)
    • This creates the buildServer.json configuration file that tells Cursor how to talk to Xcode

Running the App from VS Code

  1. Press CMD+SHIFT+P and run SweetPad: Build & Run (Launch)
  2. A new terminal pane opens and runs the Xcode CLI commands
  3. The iOS Simulator will launch (it might pop up behind your Cursor window—check your dock or hit CMD+Tab)

Making changes

  • Edit your Swift files directly in Cursor
  • Hit CMD+SHIFT+P → SweetPad: Build & Run (Launch) again to rebuild and see your updates

Bonus: Give VS Code an Xcode Look

Want VS Code to feel more like Xcode? Install the official Xcode 12 theme:

  1. In VS Code, open Extensions, and search for “Xcode Theme”. Here's one I went for.
  2. Install it, then go to Preferences → Color Theme and select the theme.

Now I can keep using Cursor + Claude Code for every step of my iPhone workflow—getting LLM hints as I code and iterating quickly, just like I do with my Python and web projects.