Firebase App Distribution with Flutter workflow editor
Deploy a Flutter app to Firebase App Distribution using the Flutter workflow editor
Set up publishing to Firebase App Distribution to distribute your Android and iOS apps to testers.
Requirements
- Add Firebase to your Flutter project
- Generate a Firebase token locally or set up a service account with Firebase App Distribution Admin role to authenticate with Firebase App Distribution.
- If your app uses Firebase services, you need to upload the Firebase configuration files to Codemagic, see the instructions here.
- Set up iOS code signing. Note that an Ad Hoc or Enterprise distribution profile is required to distribute the app outside your development team.
- Set up Android code signing. If you do not set up code signing, the artifact will be signed with a debug keystore from Codemagic build machine.
- To authenticate with Firebase, Codemagic requires either a Firebase token or a service account with Firebase App Distribution Admin role, as shown below:
1. Authenticating via service account
Using a service account is a more secure option due to granular permission settings. It can also be used to authenticate with various Firebase services, such as Firebase Test Lab and Firebase App Distribution.
On the Firebase project page, navigate to Project settings by clicking on the cog button. Select the Service accounts tab. Click on the X service accounts button as shown on the screenshot.
This will lead you to the Google Cloud Platform. In step 1, fill in the Service account details and click Create. The name of the service account will allow you to identify it among other service accounts you may have created.
In step 2, click the Select a role dropdown menu and choose the role. Note that Editor role is required for Firebase Test Lab and Firebase App Distribution Admin for Firebase App Distribution.
In step 3, you can leave the fields blank and click Done.
In the list of created service accounts, identify the account you have just created and click on the menu in the Actions column, then click Manage keys.
In the Keys section, click Add Key > Create new key. Make sure that the key type is set to
JSON
and click Create. Save the key file in a secure location to have it available.
2. Authenticating via token
firebase tool
. Please authenticate using a service account, as described below.To retrieve your Firebase token, follow the instructions in Firebase documentation.
Enabling publishing to Firebase App Distribution
- Navigate to App settings > Distribution > Firebase App Distribution.
- Choose either Firebase token or Firebase service account as the authentication method.
- Enter the Firebase token or upload the service account JSON key respectively.
- Provide the Firebase app ID for Android and/or iOS. Note that the fields for Android or iOS configuration are displayed conditionally based on the selected build platforms at the top of the page.
- Enter the alias(es) of the tester groups to whom you want to distribute your Android or iOS app. To enter multiple groups, separate them with a comma or a space, or press Enter after each value.
- For Android, select whether you wish to publish the Android app bundle, the Android APK artifact, or select Automatic to publish either the Android app bundle (preferred) or the APK artifact (when no AAB is available).
- Select Publish even if tests fail to upload the artifacts even when one or more tests have failed.
- Finally, select Enable publishing to Firebase App Distribution at the top of the section to enable publishing.
Note:
- If no suitable artifacts are found, publishing to Firebase App Distribution is skipped.
- Each uploaded binary must have a different version to appear in the Firebase console, see how to increment build version.
- Release notes can be published with the build if you have added them to your repository, read more here.