CLI Commands
Full reference for every SwiftPatch CLI command.
Deploy
swiftpatch deploy
Bundle, upload, and release an OTA update.
swiftpatch deploy -p <platform> [options]
Options
| Flag | Description | Default |
|---|---|---|
-p, --platform <platform> | ios or android | Auto-detect |
-a, --app <app-id> | App ID or slug (e.g., my-app) | Auto-detect |
-o, --org <org-id> | Organization ID | Default org |
--app-version <version> | Target app version (semver, e.g., 1.2.3) | From package.json |
-e, --entry-file <path> | Entry file path | index.js |
-n, --release-note <note> | Release notes | "" |
-k, --private-key <path> | RSA private key for signing | -- |
--hermes | Compile to Hermes bytecode | false |
-m, --mandatory | Force immediate update | false |
--paused | Create release in paused state | false |
--dev | Create a development bundle | false |
--sourcemap | Generate sourcemaps | false |
--ci-token <token> | CI authentication token | $SWIFTPATCH_CI_TOKEN |
-y, --yes | Skip confirmation prompts | false |
What happens when you deploy:
- Runs
react-native bundle - Compiles to Hermes bytecode (if
--hermes) - Computes a SHA-256 hash
- Uploads the bundle
- Creates a live release
--app-version must exactly match the native binary version (CFBundleShortVersionString on iOS, versionName on Android). A mismatch means the SDK will not find your release.
If Hermes is enabled (default since RN 0.70+), you must use --hermes. A plain JS bundle causes a crash loop on Hermes apps.
Examples
# iOS with Hermes
swiftpatch deploy -p ios --hermes --app-version 42.0 -n "Fixed checkout crash"
# Mandatory Android update in CI
swiftpatch deploy -p android --hermes --app-version 3.1.0 --mandatory --ci-token "$SWIFTPATCH_CI_TOKEN" -y
# Paused release for staged rollout
swiftpatch deploy -p ios --hermes --paused
swiftpatch rollback
Roll back the latest release for an app and platform.
swiftpatch rollback -a <app-id> -p <platform>
Use swiftpatch rollback for the latest release. Use swiftpatch releases rollback <release-id> for a specific release.
Authentication
swiftpatch login
swiftpatch login
Opens a browser-based login flow. Credentials are stored locally.
swiftpatch logout
swiftpatch logout
Clears stored credentials.
swiftpatch whoami
swiftpatch whoami
Shows your current user and organization.
App Management
swiftpatch apps list
swiftpatch apps list [-o <org-id>]
swiftpatch apps create
swiftpatch apps create --name <name> --platform <platform> [-o <org-id>]
| Flag | Description |
|---|---|
--name <name> | App display name (required) |
--platform <platform> | ios, android, or both |
-o, --org <org-id> | Organization ID |
swiftpatch apps info
swiftpatch apps info <app-id>
swiftpatch apps update
swiftpatch apps update <app-id> --name "New Name"
swiftpatch apps delete
swiftpatch apps delete <app-id>
Deleting an app removes all releases, channels, and CI tokens. This cannot be undone.
Release Management
swiftpatch releases list
swiftpatch releases list -a <app-id>
swiftpatch releases rollout
Update the rollout percentage of a release.
swiftpatch releases rollout <release-id> --percent <0-100>
Example: Gradual rollout
swiftpatch releases rollout rel_abc123 --percent 10
swiftpatch releases rollout rel_abc123 --percent 50
swiftpatch releases rollout rel_abc123 --percent 100
swiftpatch releases rollback
swiftpatch releases rollback <release-id>
Roll back a specific release by ID.
Channels
Channels target different user groups (e.g., production, beta, staging).
swiftpatch channels list
swiftpatch channels list -a <app-id>
swiftpatch channels create
swiftpatch channels create -a <app-id> --name <channel-name>
swiftpatch channels delete
swiftpatch channels delete <channel-id> -a <app-id>
CI Tokens
CI tokens authenticate automated environments like GitHub Actions or Bitrise.
swiftpatch ci-tokens create
swiftpatch ci-tokens create
Generates a new CI token. Shown only once -- copy it immediately.
CI tokens use the prefix sp_ci_ and are shown only at creation time.
swiftpatch ci-tokens list
swiftpatch ci-tokens list
swiftpatch ci-tokens delete
swiftpatch ci-tokens delete <token-id>
Revokes a CI token. Pipelines using it lose access immediately.
swiftpatch ci-tokens regenerate
swiftpatch ci-tokens regenerate <token-id>
Revokes and replaces a CI token in one step.
Configuration
Set persistent defaults to skip repetitive flags.
swiftpatch config list
swiftpatch config list
swiftpatch config set
swiftpatch config set <key> <value>
Example:
swiftpatch config set defaultOrg org_abc123
swiftpatch config set defaultApp my-app
swiftpatch config set defaultPlatform ios
# Now deploy with just:
swiftpatch deploy --hermes
swiftpatch config get
swiftpatch config get <key>
swiftpatch config delete
swiftpatch config delete <key>
Available keys:
| Key | Description |
|---|---|
apiUrl | API base URL |
defaultOrg | Default organization ID |
defaultApp | Default app ID or slug |
defaultPlatform | Default platform |
defaultChannel | Default release channel |
claudeApiKey | API key for AI features |
aiConsentScopes | AI data usage consent scopes |
Setup and Diagnostics
swiftpatch init
swiftpatch init
Sets up SwiftPatch in your project and creates a local config file.
swiftpatch doctor
swiftpatch doctor
Checks your environment for common problems.
swiftpatch generate-key-pair
swiftpatch generate-key-pair [-o <directory>]
Generates RSA-2048 keys for bundle signing. Creates two .pem files:
private.pem-- keep secret, pass todeploy --private-keypublic.pem-- embed in your SDK config
swiftpatch generate-key-pair -o ./keys
swiftpatch deploy -p ios --hermes -k ./keys/private.pem
Never commit private.pem to version control. Add it to .gitignore.
Common Workflows
First deploy
swiftpatch login
swiftpatch init
swiftpatch apps create --name "My App" --platform both
swiftpatch deploy -p ios --hermes --app-version 1.0.0 -n "Initial OTA release"
Hotfix with mandatory update
swiftpatch deploy -p ios --hermes --app-version 2.3.0 --mandatory -n "Fixes payment crash"
Staged rollout
swiftpatch deploy -p android --hermes --paused -n "New onboarding flow"
swiftpatch releases list -a my-app
swiftpatch releases rollout rel_xyz --percent 5
swiftpatch releases rollout rel_xyz --percent 25
swiftpatch releases rollout rel_xyz --percent 100
# If something goes wrong:
swiftpatch releases rollback rel_xyz
Deprecated Commands
publish-bundle, release-bundle, and release are deprecated. Use swiftpatch deploy instead.