I have different build configurations (Debug, Stage, Prod) defined for my app and I use User-Defined build settings:
to set up Facebook log
Actually there's a better solution.
You can replace Env variables(including User-Defined) manually using my swift script.
It takes two arguments: input and output paths. Goes through all input plist values recursively (if you need to can add dict keys to be processed too), and replaces all Env variables it founds. And writes to output path.
This is how you use it in your Run script phase
:
/usr/bin/xcrun --sdk macosx swift "${PROJECT_DIR}/scripts/replacePlistEnvironmentVariables.swift" "${PROJECT_DIR}/GoogleService-Info.plist" "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist"