Skip to content

Instantly share code, notes, and snippets.

@KoheiKanagu
Last active July 25, 2020 14:38
Show Gist options
  • Save KoheiKanagu/58cb51cb04f95f2b299e7643b5d5a289 to your computer and use it in GitHub Desktop.
Save KoheiKanagu/58cb51cb04f95f2b299e7643b5d5a289 to your computer and use it in GitHub Desktop.
GoogleService-Info.plistをFlavor毎に切り替えるRunScript
# 参考: [flutterで本番/ステージング/開発を切り替える \- Qiita](https://qiita.com/ko2ic/items/53f97bb7c28632268b5a#%E7%92%B0%E5%A2%83%E3%81%94%E3%81%A8%E3%81%AE%E8%A8%AD%E5%AE%9A)
rm -rf "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
echo "-----${CONFIGURATION}-----"
echo "-----${SRCROOT}-----"
if [ "${CONFIGURATION}" = "Debug" ] || [ "${CONFIGURATION}" = "Debug-Dev" ] || [ "${CONFIGURATION}" = "Release-Dev" ]; then
cp "$SRCROOT/Runner/GoogleService-Info-dev.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
echo "dev GoogleService-Info copied."
elif [ "${CONFIGURATION}" = "Release" ] || [ "${CONFIGURATION}" = "Debug-Stg" ] || [ "${CONFIGURATION}" = "Release-Stg" ]; then
cp "$SRCROOT/Runner/GoogleService-Info-stg.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
echo "stg GoogleService-Info copied."
elif [ "${CONFIGURATION}" = "Release-Prod" ] || [ "${CONFIGURATION}" = "Debug-Prod" ]; then
cp "$SRCROOT/Runner/GoogleService-Info-prod.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"
echo "prod GoogleService-Info copied."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment