Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Debug or Release for Custom Configuration With Run Script

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
like image 998
Hamed Avatar asked Dec 01 '25 05:12

Hamed


2 Answers

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
like image 117
Hamed Avatar answered Dec 03 '25 22:12

Hamed


Verify that you have set the correct configuration in the scheme settings:

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.

like image 21
pckill Avatar answered Dec 04 '25 00:12

pckill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!