How can I prevent using the Settings.bundle in Release build v.s. Debug build?

前端 未结 3 722
北恋
北恋 2021-02-09 07:07

I need to have a settings.bundle in our debug build, but don\'t want to have it in our Release. How do I approach this? Is there a runscript I can use to remove it from the copy

3条回答
  •  深忆病人
    2021-02-09 07:29

    You can write a script to delete the setting bundle altogether for a certain build configuration. For the target, under "Build Settings", there is an option to run a script. This script should do what you need:

    BUILD_APP_DIR=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
    
    if [ "$CONFIGURATION" == "Release" ]; then
        rm -Rf $BUILD_APP_DIR/Settings.bundle
        echo "Removed Settings Bundle"
    fi
    

    The "shell" field can read "/bin/sh"

提交回复
热议问题