In Xcode, how can you check environment variables to know which build configuration or scheme you have selected?

感情迁移 提交于 2019-12-24 14:57:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!