问题
From my script in "Run Script" under the Project > Target > Build Phases is there a way to know which build configuration you have run I want to copy some private bundle files if it's the Debug build config, but not copy them if it's the Release config. Is there a way to either set an Env Variable in the Build Config, or simply get the name of the build config when running?
Thanks!
回答1:
This worked for me:
if [[ "$CONFIGURATION" == "Debug" ]]
then
echo "Copying ./BundlePrivate b/c BuildConfiguration=$CONFIGURATION"
ditto ./BundlePrivate/ "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH"
else
echo "Not copying ./BundlePrivate b/c BuildConfiguration=$CONFIGURATION"
fi
来源:https://stackoverflow.com/questions/17181125/in-xcode-how-can-you-check-environment-variables-to-know-which-build-configurat