Skip to content

Instantly share code, notes, and snippets.

@ampersanda
Created April 21, 2020 07:08
Show Gist options
  • Save ampersanda/595380640ad3f7ed894063e784828412 to your computer and use it in GitHub Desktop.
Save ampersanda/595380640ad3f7ed894063e784828412 to your computer and use it in GitHub Desktop.
Flutter iOS Setup change flavor
#!/bin/bash
sed -i .bak 's/main_production.dart/main_staging.dart/g' ios/Flutter/Generated.xcconfig
sed -i .bak 's/Production App Name/Staging App Name/g' ios/Runner/Info.plist
sed -i .bak 's/"com.app.production"/"com.app.staging"/g' ios/Runner.xcodeproj/project.pbxproj
# Do something to replace profiles or API Keys
# For ease to switch between plists profile
cp GoogleService-Info-staging.plist GoogleService-Info.plist
mv GoogleService-Info.plist ios/Runner/GoogleService-Info.plist
if ! type "$PWD/fvm" > /dev/null; then
echo '▵ Using flutter'
flutter clean
flutter pub get
else
echo '▵ Using fvm'
./fvm clean
./fvm pub get
fi
open ios/Runner.xcworkspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment