如何停止X code来自shell脚本构建 [英] How to stop Xcode build from shell script
问题描述
我目前的工作与第X code的应用程序,我已经添加了一个运行shell脚本中的构建阶段。
I am currently working on an app in Xcode where I've added a Build Phase that runs a shell script.
该脚本查找从桌面并将其复制到应用程序的资源。如果文件/文件夹不存在,该脚本应取消该应用程序的构建。
The script looks for resources from the Desktop and copies them to the app . If the files/folders don't exist, the script should cancel the build of the app.
我曾尝试各种事物停止构建,如 X codebuild干净
,但我不能完全弄清楚。以下是我有:
I have tried various things to stop the build such as xcodebuild clean
but I can't quite figure it out. Here is what I have:
if [ -d ~/Desktop/MyFolder ]; then
cp -r ~/Desktop/MyFolder ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MyFolder
else
#Stop the build
fi
有没有办法让脚本告诉X code停止建设?如果是这样,我该怎么办呢?
Is there a way to have the script tell Xcode to stop the build? If so, how can I do it?
推荐答案
您需要从脚本返回一个非零退出code:
You need to return a non-zero exit code from the script:
exit 1
这篇关于如何停止X code来自shell脚本构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!