SweetPad
github.com/sweetpad-dev/sweetpad- Category
- Developer Tools
- Rank
- No. 997Tools index
Previous survey · No. 985 ·
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Coding
- Interfaces
- CLI
- GitHub
- 1.9k stars
- Latest release
- cli-v0.1.27
- Date
About
SweetPad is a command-line tool that builds, runs, debugs and tests apps for iOS, macOS, tvOS, watchOS and visionOS without opening Xcode. It works with Xcode projects and workspaces, Tuist, XcodeGen and Swift packages, and is aimed at both humans and coding agents.
What it does
SweetPad puts a friendlier front end on Apple's xcodebuild and simulator tooling, shipped as one Rust binary. A short command finds the project, asks once which scheme and destination you want, remembers the answer, then compiles, installs, launches and follows logs, condensing the compiler's wall of output into a handful of lines. The same binary also answers editor autocomplete requests over the Build Server Protocol (the interface SourceKit-LSP uses to ask for compiler flags), drives lldb for breakpoints and crash reports, and offers hot reload through the third-party InjectionNext. A separate VS Code extension shares the Rust core but installs on its own.
Why it's ranked here
The case rests on two things raw xcodebuild lacks. One is a machine surface built for automation: every command can return a JSON envelope or a line-per-event stream, failures map to six distinct exit codes, and a bundled agent skill lists which commands never return and how to bound them. The other is care over argument handling: the code keeps a list of 57 value-taking xcodebuild flags, probed against Xcode, so passthrough arguments parse the way Xcode parses them. The limits are real: one listed author, a CLI still versioned below 1.0, and macOS only. For headless Apple builds driven by scripts or agents, the design choices hold up.
What's good
The strengths are specific. JSON mode separates 'the command ran' from 'the outcome was good', so a failing test run is still well-formed data with its own pass field. Log reads accept a substring to wait for plus a timeout and exit on the first match, which replaces guessing with sleep. Crash triage runs the app under lldb with a 30 second default bound and maps Mach exceptions to familiar signal names. Simulator install, launch and terminate each get a two-minute ceiling and a recovery tip. Empty environment variables count as unset, so a CI placeholder cannot pass an empty scheme. Unit tests sit beside the core Rust modules.
Tradeoffs
It needs macOS and Xcode, which rules out Linux CI runners. Hot reload depends on the third-party InjectionNext, works only on simulators and native macOS (not physical devices or watchOS), and on macOS turns off the hardened runtime and App Sandbox for that build. The licence is stated two ways: the README says MIT, while the Rust workspace manifest declares MIT or Apache 2.0. The autocomplete server describes itself as an early scope, with compiler flags resolved per target and per-file flags deferred. The VS Code extension depends on the Sentry error-reporting SDK, and the CLI has a feedback command that sends reports to the maintainer.
How to use it well
Best fit: an agent or CI job that must build and test an iOS or macOS app without the Xcode window. Give agents the finite forms: JSON output, non-interactive mode, runs that skip log following, and log reads bounded by a time window or a match. In a fix loop, the quiet build plus the separate diagnostics read avoids a second compile; after editing tests, compile the test targets explicitly, since a plain build covers only the Run targets. Neovim, Zed, Helix and Emacs users get autocomplete from one setup command. Developers who live in VS Code can take the extension instead, which does not require the CLI.
Technical notes+
The Rust workspace in Cargo.toml has four members: sweetpad-lib (Apple file formats), sweetpad-core (shared orchestration), sweetpad-cli (the binary) and the N-API addon under sweetpad-vscode/native that the extension loads. sweetpad-cli/src/cli/mod.rs denies clippy::print_stdout and print_stderr module-wide so every byte goes through the Output layer that enforces the json/ndjson/quiet contract, and scrub_empty_env drops empty SWEETPAD_* variables before clap reads them. sweetpad-core/src/xcodebuild_args.rs holds VALUE_FLAGS (57 entries) and SWITCHES (18), and its read walker pairs each value flag with the next argument even when it starts with a dash; the CLI and the BSP server share it. sweetpad-core/src/hot.rs adds OTHER_LDFLAGS with -Xlinker -interposable and EMIT_FRONTEND_COMMAND_LINES=YES, and for macosx also ENABLE_HARDENED_RUNTIME=NO and ENABLE_APP_SANDBOX=NO. sweetpad-core/src/bsp/mod.rs speaks JSON-RPC over stdio, runs buildTarget/prepare on a serialized worker thread, and queues a startup warm-up of every target behind client requests. The agent contract (exit codes 0 to 6, the never-returning commands) is in skills/sweetpad/SKILL.md.
Observed
- License
- MIT per README and extension manifest; MIT OR Apache-2.0 in the Rust workspace Cargo.toml
- Language
- Rust (CLI and core), TypeScript (VS Code extension)
- Install
- Homebrew tap: brew install sweetpad-dev/tap/sweetpad
- Interfaces
- CLI with JSON and NDJSON output, Build Server Protocol server, debug adapter, VS Code extension, bundled agent skill
- Platform
- macOS with Xcode required
- Project formats
- Xcode projects and workspaces, Tuist, XcodeGen, Swift packages
- Hot reload
- Via InjectionNext on iOS, tvOS and visionOS simulators and native macOS; not physical devices or watchOS
- Tests
- Inline Rust unit tests in core modules; Vitest and VS Code end-to-end scripts in the extension manifest
- Error reporting
- VS Code extension depends on @sentry/node
Read from README.md, Cargo.toml, package.json, sweetpad-vscode/package.json, sweetpad-vscode/README.md, sweetpad-cli/CLI_DESIGN.md, sweetpad-cli/Cargo.toml, sweetpad-cli/src/cli/mod.rs, sweetpad-core/src/lib.rs, sweetpad-core/src/xcodebuild_args.rs, sweetpad-core/src/hot.rs, sweetpad-core/src/bsp/mod.rs, sweetpad-vscode/src/run/main.ts, skills/sweetpad/SKILL.md.
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.