How could detect debug or release is running with build phases/run script?
I have four custom configuration each one duplicated from release or debug.
I found this answer but it doesn't work
if [ "${CONFIGURATION}" = "Release" ]; then
echo "Relese"
else
echo "Debug"
fi
Assume these are custom configurations: CustomDebug1, CustomDebug2, CustomRelease1, CustomRelease2
Conditions should be on these configurations like this
PATH_TO_GOOGLE_PLISTS="${PROJECT_DIR}/MobileToken"
if [ "${CONFIGURATION}" = "CustomDebug1" ]; then
echo "CustomDebug1"
fi
if [ "${CONFIGURATION}" = "CustomDebug2" ]; then
echo "CustomDebug2"
fi
if [ "${CONFIGURATION}" = "CustomRelease1" ]; then
echo "CustomRelease1"
fi
if [ "${CONFIGURATION}" = "CustomRelease2" ]; then
echo "CustomRelease2"
fi
Verify that you have set the correct configuration in the scheme settings:

Usually it is set to Debug in the Run step, but in this screenshot it is set to Release for the sake of example. Otherwise your script should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With