Create a Patch
Once you have published a release of your app, you can push updates using one of
the shorebird patch commands.
Patching Multiple Platforms Simultaneously
Section titled “Patching Multiple Platforms Simultaneously”If your app supports multiple platforms, you can build and publish patches for
them in a single command using the --platforms (or -p) option:
This will build and promote the patches for the specified platforms to their respective releases in one step.
This will do several things:
- Builds the artifacts for the update.
- Downloads the corresponding release artifacts.
- Generates a patch using the diff between the release and the current changes.
- Uploads the patch artifacts to the Shorebird backend.
- Promotes the patch to the stable channel.
Example output:
By default, this uses the release version from the compiled artifact. If you
want to target the latest release version, you can use
--release-version latest. For example:
If you want to patch a different release version, you can use the
--release-version option. For example:
If your application supports flavors or multiple release targets, you can
specify the flavor and target using the --flavor and --target options:
Options
Section titled “Options”| Option | Abbreviation | Description |
|---|---|---|
--release-version | The release version to patch (e.g., 1.0.0+1). Use latest to target the most recently updated release. | |
--platforms | -p | Comma-separated list of platforms to patch simultaneously (e.g., android,ios). |
--flavor | The product flavor to use when building. | |
--target | -t | The main entrypoint file of the application. |
--track | The deployment track to publish to (default: stable). Use staging to publish to a staging track first. | |
--dry-run | -n | Build and validate the patch but do not upload it. Ideal as a CI sanity check. |
--allow-asset-diffs | Publish even if asset differences are detected. Not recommended. | |
--allow-native-diffs | Publish even if native code differences are detected. Not recommended. |
iOS-specific Options
Section titled “iOS-specific Options”| Option | Description |
|---|---|
--no-codesign | Skip code signing for the iOS build. |
--export-options-plist | Path to a custom ExportOptions.plist for the iOS archive export step. |
--export-method | Distribution method: app-store, ad-hoc, development, or enterprise. |
--min-link-percentage | Minimum % of Dart code that must be linked (not interpreted) for the patch to publish. iOS only. |
Patch Performance
Section titled “Patch Performance”Android
Section titled “Android”Patching an application on Android has no effect on performance.
iOS and macOS
Section titled “iOS and macOS”Patching an application on iOS and macOS typically does not affect application performance. However, the patching mechanism on iOS and macOS is different from Android. Unchanged code runs as normal (on the CPU), changed (or added) code will run in a Dart interpreter (slower than the CPU). Typically this change is undetectable, but if you are changing particularly performance-sensitive Dart code (e.g., code for processing images, or large datasets), you may see a performance difference after patching.
You can always test your patches before sending them to users by staging patches. For a detailed look at how iOS and macOS patching works, see System Architecture.
If you ever see unexpected performance changes when patching, please contact us, and we would love to help!
Manage Patches
Section titled “Manage Patches”You can manage your patches directly from the command line using the
shorebird patches commands.
List Patches
Section titled “List Patches”To list all patches associated with a specific release version:
This will display a list of all patches published for that release, their patch numbers, active status, and tracks.
View Patch Details
Section titled “View Patch Details”To view detailed information for a specific patch number:
This command shows metadata for the specified patch, including build logs, checksums, and deployment track information.
Promote a Patch
Section titled “Promote a Patch”If you published a patch to a staging track (e.g., staging) and verified it
works correctly, you can promote it directly to the stable track using:
Set Patch Track
Section titled “Set Patch Track”To assign a patch directly to a specific deployment track (e.g., promoting or routing to a staging beta group):