在 XCode 中编辑运行脚本构建阶段
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1344357/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Editing a run script build phase in XCode
提问by Spanky
In XCode I made a new run script build phase and want to do one of two things:
在 XCode 中,我创建了一个新的运行脚本构建阶段,并想做以下两件事之一:
- Edit it
- Delete it
- 编辑它
- 删除它
I can see how to add a new one, but not how to access the existing one?
我可以看到如何添加一个新的,但看不到如何访问现有的?
采纳答案by ttvd
In xcode project tree, click on targets, then pick the target for which you added script. Each time you add new script/event it will show up as a new grey folder in target's subtree. Pick folder named 'Run Script', right click, select 'Get info': script body will be in 'General' tab.
在 xcode 项目树中,单击目标,然后选择为其添加脚本的目标。每次添加新脚本/事件时,它都会在目标的子树中显示为一个新的灰色文件夹。选择名为“运行脚本”的文件夹,右键单击,选择“获取信息”:脚本主体将在“常规”选项卡中。
If you have multiple scripts, you probably would want to rename them in that target tree.
如果您有多个脚本,您可能希望在该目标树中重命名它们。
回答by Elezar
I realize this is really old (And the solution I'm mentioning might not have even existed when it was asked), but I came across it when looking into how to do the same thing, and thought it would be useful to put in my findings for anyone else. I've discovered that if you check the box for Run script only when installingon the run script screen, then it will only run when you do an Archive. I guess since there isn't an "Install" option for iOS apps, Archive gets treated as the same thing, at least for this purpose.
我意识到这真的很旧(而且我提到的解决方案在被问到时甚至可能不存在),但是我在研究如何做同样的事情时遇到了它,并认为把它放在我的其他人的发现。我发现如果您在运行脚本屏幕上安装时选中仅运行脚本框,那么它只会在您执行存档时运行。我想因为 iOS 应用程序没有“安装”选项,所以存档被视为相同的东西,至少为此目的。
回答by Xcode Guru
For people who have been searching for how to add a run script build phase, there is a simple step-by-step guide (with screenshots) at http://runscriptbuildphase.com. It shows both Xcode 4 and Xcode 3.
对于一直在寻找如何添加运行脚本构建阶段的人,http://runscriptbuildphase.com 上有一个简单的分步指南(带有屏幕截图)。它显示了 Xcode 4 和 Xcode 3。
回答by Spanky
Found it!
找到了!
In the XCode Build System Guide look at Adding and Deleting Build Phases.
在 XCode 构建系统指南中查看添加和删除构建阶段。
In your XCode project, under Targets in the Groups and Files pane you can see the Run Script... double click to edit, delete to delete.
在您的 XCode 项目中,在 Groups and Files 窗格中的 Targets 下,您可以看到 Run Script... 双击编辑,delete 删除。
// :)
// :)