I'm trying to add firebase for my own project in dev and production environtment. I need to add GoogleService-Info.plist for Dev and Prod environment.
After add new run script phase. There's error show phase script execution failed.
GOOG_DEV=${PROJECT_DIR}/${TARGET_NAME}/Debug/GoogleService-Info-Dev.plist
GOOG_PROD=${PROJECT_DIR}/${TARGET_NAME}/Release/GoogleService-Info.plist
GOOG_DST=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist
if [ "${CONFIGURATION}" == "Release" ]; then
GOOG_SRC="${GOOG_PROD}"
else
GOOG_SRC="${GOOG_DEV}"
fi
if [ ! -f "$GOOG_SRC" ]; then
echo "Missing 'GoogleService-Info.plist' source at '${GOOG_SRC}"
exit 1
fi
cp "${GOOG_SRC}" "${GOOG_DST}"
GoogleService plist located like image below googleservice plist location
NOTE
This will run smoothly if i'm using the same GoogleService-Info.plist NAME for both dev and prod
and i just tick the checkbox for 1 one of them in target Membership when i build the app. But it's really bother me to change it for every build environment changes