简体   繁体   English

如何将“运行脚本”构建阶段限制为我的发布配置?

[英]How can I limit a “Run Script” build phase to my release configuration?

I have a shell script that I would like to run at the end of my target's build phase.我有一个 shell 脚本,我想在目标的构建阶段结束时运行它。 However, I would like this script to only run when I build with the release configuration.但是,我希望此脚本仅在我使用发布配置构建时运行。 How can this be done?如何做到这一点? Thanks!谢谢!

if [ "${CONFIGURATION}" = "Release" ]; then
  echo Do something really release-like
fi

The script will run at the end of every configuration, but it won't do anything in this case unless the configuration is Release (assuming everything it does is contained within the test block).该脚本将在每个配置结束时运行,但在这种情况下它不会做任何事情,除非配置是 Release(假设它所做的一切都包含在测试块中)。

最简单的方法是选中“仅在安装时运行脚本”复选框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Xcode 6中删除“运行脚本”构建阶段? - How can I delete a “Run Script” build phase in Xcode 6? 如何以编程方式将运行脚本构建阶段添加到 Xcode 项目? - How can I programmatically add a run script build phase to an Xcode project? 我可以在问题导航器和构建日志中完全自定义Xcode 4运行脚本构建阶段错误/警告吗? - Can I fully customise an Xcode 4 Run Script Build Phase error/warning within the Issues Navigator and Build Logs? 如果构建中断,如何使XCode运行脚本构建阶段运行? - How to make XCode Run Script Build Phase run if the build breaks? Xcode构建阶段-运行脚本。 如何在方案中定义变量以在构建阶段脚本中读取? - Xcode Build Phase - Run Script. How to define a variable in a scheme to read at build phase script? 如何通过XCode中的运行脚本构建阶段添加编译源? - How do I add compile sources via a run script build phase in XCode? 如何在Xcode 4中的Run Script构建阶段中使用sudo? - How to use sudo inside of a Run Script build phase in Xcode 4? 如果运行脚本阶段出现错误,如何中止构建 - How to abort build if run script phase gives an error 如何在Xcode的Run Script Build阶段中使用Swift Flags? - How to use Swift Flags inside a Run Script Build Phase in Xcode? 如何在IOS Xcode的构建阶段中编写运行脚本 - How to Write Run Script in Build Phase in IOS Xcode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM