Code Push with Shorebird
Deploy app updates to users' devices using Shorebird in Flutter workflow editor
Code push for Flutter is a cloud service by Shorebird that allows developers to push over-the-air (OTA) app updates directly to users’ devices without publishing each update on app stores. With Codemagic, you can use Shorebird to build and publish a release or a patch for Android and iOS.
Prerequisites
In order to configure a Shorebird workflow in Codemagic, the following is needed:
- Shorebird needs to be initialized for your Flutter project;
- A token for authentication with Shorebird, see how to create the token here;
- Code signing files.
Building a release
Release builds can be published to app stores and patched once they’ve been distributed. Read more about Shorebird releases.
- In workflow editor, select the platforms for which you want to build. Only Android and iOS are supported with Shorebird for now.
- Under Publish updates to user devices using Shorebird, select Release.
- Scroll to the Shorebird section and specify the Flutter version and the Xcode version (if you selected iOS) to be used for building the app.
- Copy-paste your token generated with Shorebird CLI in the Shorebird token field. Once you save it, the token can no longer be viewed, only modified or deleted.
- If your Flutter project is not in the root of the repository, update the Project path to point to the right directory.
- You can add additional build arguments to the
shorebird release
build command, e.g. to specify the flavor or target for your app. See more info here. - Scroll down to the Distribution section to set up code signing. You can follow the guides for iOS code signing and Android code signing respectively.
- Save the settings and start a new build. On successful build, the release artifact will be uploaded to your Shorebird console.
Please note:
If you also wish to distribute the same artifact to the stores, you can configure publishing to App Store or Google Play as part of the workflow.
Every release must have a unique version. Read how to set up automatic build versioning with Codemagic.
Building a patch
Once you have a published a release of your app, you can patch it by pushing an app update directly to users’ devices. Read more about Shorebird patches.
- In workflow editor, select the platforms for which you want to build. Only Android and iOS are supported with Shorebird for now.
- Under Publish updates to user devices using Shorebird, select Patch.
- Scroll to the Shorebird section and specify the Xcode version (if you selected iOS) to be used for building the app. Note that it is recommended to use the same Xcode version that was used to build the app version you are going to patch so as to avoid warnings about the app containing native changes.
- Specify the Android release version and/or the iOS release version to patch. To patch the latest release, set the value to
latest
or leave empty. - Copy-paste your token generated with Shorebird CLI in the Shorebird token field. Once you save it, the token can no longer be viewed, only modified or deleted.
- If your Flutter project is not in the root of the repository, update the Project path to point to the right directory.
- You can add additional build arguments to the
shorebird patch
build command, e.g. to specify the flavor or target for your app. See more info here. - Scroll down to the Distribution section to set up code signing. You can follow the guides for iOS code signing and Android code signing respectively.
- Save the settings and start a new build. On successful build, the patch artifact will be uploaded to your Shorebird console.