[ Documentation ]
peach swift

peach swift

Runs a foreground preview for a directory containing Package.swift and Swift sources, or for the application target of an Xcode project or workspace, whether its projects are project.pbxproj files or the JSON project.xcproj files Xcode 27 writes. It builds what Xcode builds for that target: the framework and library targets of every project in the workspace that the app depends on or links, and the local Swift packages they use. Remote Swift package products compile from source at the revisions Package.resolved pins in the opened workspace, fetched into .build/peach under the workspace. Build settings in Info.plist expand as Xcode expands them, an undefined setting to nothing. When the app imports modules Peach does not provide, the command lists every one with the files importing it and, for a package Peach cannot compile, the reason. When compilation fails, it ends with the APIs Peach lacks, each with its error count and files. The built-in guest mounts the Swift root and preserves view state across source edits. The command needs no author JavaScript entry, Vite configuration or node_modules. It compiles on this machine with the swift.org toolchain and wasm SDK release peach names, against the prebuilt Swift distribution PEACH_SWIFT_ENDPOINT points to; no source leaves the machine. —upload-source instead sends this directory and its watched source and resource edits to the authenticated Contrast compiler. Stop with Ctrl+C to close the owned preview and host.

terminal
peach swift <SwiftPM-directory | Xcode project> [--target <app target>]

Options

flagdescription
--target <name>the Xcode application target to run, when the project has more than one
--upload-sourcecompile on Contrast instead: consent to uploading the selected package and its watched edits; requires peach login or PEACH_API_KEY
--host-port <port>pin the loopback Swift preview port; otherwise an available port is selected
--no-openkeep the Swift host running for Connect Swift without opening a preview
--headlesslaunch the owned browser preview without a visible window
--device <model>select the simulated device
--driver <playwright|desktop|electron>select the existing preview driver
--cdp-port <port>pin the Playwright debugging endpoint

Examples

terminal
peach swift ./MyApp
peach swift ./MyApp.xcodeproj
peach swift ./MyApp.xcworkspace --target MyApp