Created
April 21, 2020 07:08
-
-
Save ampersanda/595380640ad3f7ed894063e784828412 to your computer and use it in GitHub Desktop.
Flutter iOS Setup change flavor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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