Preview Locally
Once you have created a release, you can preview your
release with the shorebird preview command: on an Android device or emulator,
on a physical iPhone or iPad, or, for a macOS, Linux or Windows release, on the
computer you run it on.
This will download the release artifacts for the selected app release version, install the app on the selected device, and start the application.
On Android, Shorebird 1.6.135 and newer uninstall the app before installing the release, which deletes its data and any files in its app-specific storage. Older versions clear the app’s data instead.
Options
Section titled “Options”Without options, shorebird preview asks which release and which device to use.
The options you’re most likely to need:
--release-version 1.0.0+1picks the release, and--device-id(-d) the device or Android emulator. iOS simulators aren’t supported.--track stagingpreviews the release with patches from that track instead ofstable. See Test the patch on your device.
Run shorebird preview --help for every option.
Android keystore options
Section titled “Android keystore options”To sign an Android preview with your deployment keystore instead of a debug key,
pass it with --ks and the key’s alias with --ks-key-alias. --ks-pass takes
the keystore password prefixed with pass: (the password itself) or file: (a
file that holds it). Add --ks-key-pass if the key’s password differs from the
keystore’s.
iOS signing
Section titled “iOS signing”On iOS, shorebird preview installs the app from the .xcarchive that
shorebird release ios built, not the IPA you upload to App Store Connect. A
device only installs that app if the provisioning profile it was signed with
allows it:
- A development or ad hoc profile that includes the device: the preview installs.
- An App Store distribution profile: no device installs it, and
shorebird previewfails with an error about the provisioning profile. TestFlight builds are signed the same way, so they don’t help either.
The archive is signed with the Release configuration’s settings in Xcode’s
Signing & Capabilities tab. --export-options-plist and --export-method
don’t change it: they only decide how the IPA is signed when Xcode exports it
from the archive.
Preview and ship the same release
Section titled “Preview and ship the same release”Sign the archive for development and export the IPA for the App Store. One release then installs on your test devices and is the build you upload:
- In Xcode, select the Runner target, open Signing & Capabilities, and check Automatically manage signing. Xcode signs the archive with your Apple Development certificate and a development profile. If you sign manually, choose a development or ad hoc profile for the Release configuration instead.
- Run
shorebird release ios. Without--export-methodor--export-options-plist, Xcode exports the IPA for the App Store, re-signing it with your distribution certificate. If you sign manually, pass an ExportOptions.plist that names your App Store profile. - Upload the IPA from
build/ios/ipaas usual, and preview the release withshorebird preview.
The device has to be in the profile when you release. A device added to the profile later can’t install that release, so create a new release to preview on it.
Add-to-app
Section titled “Add-to-app”Because Flutter modules (.aars and .xcframeworks, created with
shorebird release aar and shorebird release ios-framework, respectively) are
embedded in apps that Shorebird does not know about, shorebird preview does
not support them.
To test these releases, you can use your normal development flow with the artifacts that Shorebird creates. For example, if you launch your app normally from Xcode or Android Studio with a Release configuration, you will see Shorebird logs in its output. If you have published a patch, it should be downloaded on the first run of your app and visible on subsequent runs.
Previewing patches
Section titled “Previewing patches”To try a patch on your device before your users get it, publish it to the
staging track and preview the release with --track staging. The
Quick Start walks through it, from
the release to seeing the patch apply.