How to make flutter app distribution for testing in Firebase

  • Create a keystore for the app.
keytool -genkey -v -keystore ~/key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

/imgs/flutter-app-distribution-testing/Untitled.png

  • Create the key properties for Android to read the keystore. Please be noted you'd better ignore this key.properties file in .gitignore to not push it onto GitHub.
storePassword=*
keyPassword=*
keyAlias=key
storeFile=/Users/Frankie/geofencing-key.jks

/imgs/flutter-app-distribution-testing/Untitled%201.png

  • Go to Flutter docs here to configure signing in gradle for Android.

/imgs/flutter-app-distribution-testing/Untitled%202.png

  • Update the version section in the "pubspec.yaml" if needed.
  • Build the release apk package for Android.
# APK
flutter build apk --release
# App bundle (preferred)
flutter build appbundle --release

/imgs/flutter-app-distribution-testing/Untitled%203.png

  • Build the release app package for iOS, then open xcode -> Product -> Archive -> Distribute App -> Ad Hoc -> Export to get actual .ipa file. (Remember to update the xcode-Runner-General-Version first)
flutter build ios --release
  • Go to App Distribution in Firebase and drag Android apk file/iOS ipa file into related apps.

/imgs/flutter-app-distribution-testing/Untitled%204.png

  • Add testers' email and notes and submit. Testers will receive the app install email.

/imgs/flutter-app-distribution-testing/Untitled%205.png

/imgs/flutter-app-distribution-testing/Untitled%206.png

/imgs/flutter-app-distribution-testing/Untitled%207.png

/imgs/flutter-app-distribution-testing/Untitled%208.png

  • Now you will have a lot of information to input for the iOS app.

/imgs/flutter-app-distribution-testing/Untitled%209.png

/imgs/flutter-app-distribution-testing/Untitled%2010.png

/imgs/flutter-app-distribution-testing/Untitled%2011.png

  • We may probably need to configure the SH1 of the app in google cloud console if we use cloud services like google map services. Please be noted there is 1 SH1 for iOS app, and for Android app there is 1 debug SH1 and 1 release SH1 as well as 1 SH1 in Google Play Console.
#Check the release keystore (For iOS and Android release app)
keytool -list -v -keystore ~/geofencing-key.jks

#Check the debug keystore (For Android debug app)
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -list -v

/imgs/flutter-app-distribution-testing/Untitled%2012.png