Skip to main content

Introduction

SweetPad is a VSCode extension that lets you build, run, debug, and test your Xcode projects for iOS, macOS, tvOS, watchOS, and visionOS without leaving VSCode. It's built on top of the Xcode CLI tools, plus a handful of open-source tools like xcode-build-server, xcbeautify, swift-format, and pymobiledevice3.

info

You still need to have Xcode installed on your machine to use the extension because it heavily relies on the Xcode CLI tools to build and run your project.

What you getโ€‹

  • ๐Ÿ› ๏ธ Build & Run apps on simulators, macOS, and physical devices straight from the SweetPad sidebar โ€” with support for Xcode workspaces, Xcode projects, Tuist, XcodeGen, and Swift Package Manager (Package.swift).
  • ๐Ÿž Debug with breakpoints, step, watch, and the rest of LLDB via the CodeLLDB extension โ€” on the Simulator and on physical iOS devices.
  • ๐Ÿ“‹ Logs from devices and simulators stream os_log / Logger / print / NSLog into the build terminal so you don't have to keep Console.app open.
  • ๐Ÿงช Tests show up in VSCode's native Testing panel with gutter โ–ถ๏ธ buttons; supports XCTest and Swift Testing.
  • โœ๏ธ Format on save with swift-format (Xcode's bundled copy by default) or any other Swift formatter you prefer.
  • ๐Ÿ’ก Autocomplete via SourceKit-LSP backed by xcode-build-server, including inline compiler diagnostics in the Problems panel.
  • ๐ŸŒณ Git worktrees โ€” switch the active workspace between parallel checkouts of the same project in one command.
  • ๐Ÿค– Agent CLI / RPC server โ€” opt-in JSON-RPC server and bundled sweetpad CLI so scripts and AI coding agents can drive your VSCode session from the outside.

Getting startedโ€‹

tip

This tutorial also works for Cursor, an AI-first code editor that's a fork of VSCode.

First, install VSCode and the extension from the VSCode Marketplace.

Install extension

Next, create an Xcode project. We highly recommend XcodeGen or Tuist, which let you define the project structure in configuration files โ€” but plain Xcode is fine too. SweetPad also works directly with Swift Packages: open a folder that contains a Package.swift and you're good to go.

Xcode

Once you have a working Xcode project, open the project's root folder in VSCode โ€” not the .xcodeproj or .xcworkspace folder itself.

If you installed the extension correctly, you should see the SweetPad lollipop icon ๐Ÿญ in the left sidebar of the editor. This is the main entry point for using the extension.

The main panels of the extension are:

  1. Build โ€” shows the list of schemes and the "Launch" button to build and run the project.
  2. Destinations โ€” lists every place you can run on: recently used destinations, simulators, and connected devices.
  3. Tools โ€” installs and links to docs for the third-party tools SweetPad uses.

Opened project

To build and run the project, click โ–ถ๏ธ next to the scheme and wait for the build to finish. SweetPad then boots the simulator and launches the app.

That's it โ€” you've built and run your first Xcode project in VSCode. From here:

Demoโ€‹

Here is a short demo of building and running an Xcode project in VSCode: