Skip to main content

Get started with the CLI

The sweetpad command-line tool builds, runs, and tests your Xcode apps from the terminal — no editor needed. This page gets you from install to a running app in a few minutes. You need a Mac with Xcode installed.

1. Install

Install with Homebrew:

brew install sweetpad-dev/tap/sweetpad

Check that it worked:

sweetpad --version

2. Get a project

You can start a brand-new app or point SweetPad at one you already have.

Create a new project

sweetpad project new scaffolds a minimal SwiftUI app. Run it with no options and it walks you through a short set of questions — project name, iOS or macOS, bundle identifier, and so on — then creates the project for you:

sweetpad project new

Prefer to skip the questions? Pass a name (and any options you want) and it uses sensible defaults:

sweetpad project new MyApp --platform ios

When it's done, hop into the new folder:

cd MyApp

Or use an existing project

Already have a project? Just cd into it — anywhere inside a folder that has an .xcworkspace, .xcodeproj, or Package.swift. SweetPad finds the project by looking in the current folder and its parents, just like git does.

cd ~/Developer/MyApp

3. See where you are

Run sweetpad status to see what SweetPad thinks it's working with:

sweetpad status

The first time, it may not have picked a scheme or a place to run yet — that's fine, the next step sorts it out.

4. Build and run

Run your app with a single command:

sweetpad run

The first time in a project, SweetPad asks which scheme to build and which simulator or device to run on, then remembers your choice so it won't ask again. It builds the app, launches it, and streams the app's logs right in your terminal.

Want to skip the questions and just say where to run? Use --on with a simulator name, mac, or booted (whatever simulator is already open):

sweetpad run --on "iPhone 16 Pro"

5. Try a few more commands

Here are the everyday ones:

# See everywhere you can run — simulators, devices, and macOS
sweetpad devices

# Just build, don't run
sweetpad build

# Run your tests
sweetpad test

# Format your Swift files
sweetpad format

Most commands ask you to pick a scheme or destination the first time, then remember it. Run sweetpad status any time to see the current choices, or change them with sweetpad context.

Getting help

Every command explains itself with --help:

sweetpad --help # all commands
sweetpad run --help # options for one command

And there are a few longer guides built right into the tool:

sweetpad help # list the guides
sweetpad help destinations # how to pick where to run
sweetpad help config # settings you can save

Where to go next

  • The SweetPad CLI page covers every command group, saving your settings, and using the CLI in scripts and CI.
  • Prefer working in an editor? The VSCode extension does all of this from a sidebar.