Skip to content

Instantly share code, notes, and snippets.

@saileshbro
Created January 11, 2024 05:41
Show Gist options
  • Save saileshbro/4bdbddc83df19d546c5acdbf6ef2462a to your computer and use it in GitHub Desktop.
Save saileshbro/4bdbddc83df19d546c5acdbf6ef2462a to your computer and use it in GitHub Desktop.
This is a Bash script that configures FlutterFire for Android and iOS platforms by looping through each flavor and build mode and running the flutterfire configure command with the specified arguments.
#!/bin/sh
CONFIG_DIR="lib/app/config/firebase"
FLAVORS=("development" "production")
for FLAVOR in "${FLAVORS[@]}"; do
PROJECT="example-prod"
BUNDLE_ID="com.example"
if [ "$FLAVOR" = "development" ]; then
PROJECT="example-dev"
BUNDLE_ID="$BUNDLE_ID.dev"
fi
for BUILD_MODE in "Debug" "Release" "Profile"; do
flutterfire configure \
--project="$PROJECT" \
--platforms=android,ios \
--out="$CONFIG_DIR"/"$FLAVOR"/firebase_options.dart \
--android-out=/android/app/src/"$FLAVOR"/ \
--android-package-name="$BUNDLE_ID" \
--ios-bundle-id="$BUNDLE_ID" \
--ios-build-config="$BUILD_MODE"-"$FLAVOR" \
--ios-out=/ios/Firebase/"$FLAVOR"/GoogleService-Info.plist \
--overwrite-firebase-options \
--yes
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment