Skip to main content

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

FlagDescriptionDefault
-p, --platform <platform>ios or androidAuto-detect
-a, --app <app-id>App ID or slug (e.g., my-app)Auto-detect
-o, --org <org-id>Organization IDDefault org
--app-version <version>Target app version (semver, e.g., 1.2.3)From package.json
-e, --entry-file <path>Entry file pathindex.js
-n, --release-note <note>Release notes""
-k, --private-key <path>RSA private key for signing--
--hermesCompile to Hermes bytecodefalse
-m, --mandatoryForce immediate updatefalse
--pausedCreate release in paused statefalse
--devCreate a development bundlefalse
--sourcemapGenerate sourcemapsfalse
--ci-token <token>CI authentication token$SWIFTPATCH_CI_TOKEN
-y, --yesSkip confirmation promptsfalse

What happens when you deploy:

  1. Runs react-native bundle
  2. Compiles to Hermes bytecode (if --hermes)
  3. Computes a SHA-256 hash
  4. Uploads the bundle
  5. Creates a live release
Version matching is exact

--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.

Always use --hermes for Hermes apps

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>
tip

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>]
FlagDescription
--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>
Irreversible

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.

warning

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:

KeyDescription
apiUrlAPI base URL
defaultOrgDefault organization ID
defaultAppDefault app ID or slug
defaultPlatformDefault platform
defaultChannelDefault release channel
claudeApiKeyAPI key for AI features
aiConsentScopesAI 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 to deploy --private-key
  • public.pem -- embed in your SDK config
swiftpatch generate-key-pair -o ./keys
swiftpatch deploy -p ios --hermes -k ./keys/private.pem
danger

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

warning

publish-bundle, release-bundle, and release are deprecated. Use swiftpatch deploy instead.