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
Alternatively, just don't include the settings bundle in the "Copy Bundle Resources" and add a build phase run script to only include it for certain configs.
Here's a run script that also updates a version and build in the settings bundle
if [ ${CONFIGURATION} == "Debug" ] ; then
echo "Copying settings bundle..."
version=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$SRCROOT/Blah/Supporting Files/Info.plist")
build=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$SRCROOT/Blah/Supporting Files/Info.plist")
cp -r "${PROJECT_DIR}/Blah/Supporting Files/Settings.bundle" ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
echo "Updating settings bundle version to ${version}b${build}"
/usr/libexec/PlistBuddy "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Settings.bundle/Root.plist" -c "Set :PreferenceSpecifiers:17
:DefaultValue $version($build)"
fi
making sure to change out the Blah/Supporting Files
path to whatever yours actually is