如何向 Xcode 添加配置?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6218434/
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
How to add configurations to Xcode?
提问by Rodrigo
There are no other way, I search a lot. In XCode 3 this is easy, but now..
没有其他办法,我搜索了很多。在 XCode 3 中这很容易,但现在..
In the screen above, I have the Build Configuration, so I can chose if I want:
在上面的屏幕中,我有Build Configuration,所以我可以选择:
- Debug
- Release
- 调试
- 释放
This 2 kind of config, have their own config in "Build Settings" tabs (in targets config). To create I third one, the Distribution, reading here,it show this image in XCode 3
这 2 种配置,在“构建设置”选项卡(在目标配置中)中有自己的配置。要创建第三个Distribution,请在此处阅读,它在 XCode 3 中显示此图像
Where I can do the same in XCode 4????
我在哪里可以在 XCode 4 中做同样的事情????
edit-> Only create a new Schema didn't work, like this is a config in "Build Settings" tag of Targets. I can chose a config for "Debug" and "Release", but, and for I third one?
编辑-> 只创建一个新的架构不起作用,就像这是目标的“构建设置”标签中的配置。我可以为“调试”和“发布”选择一个配置,但是,对于我第三个?
回答by Abizern
Have a look at the project settings. There is a +
button that you can use to add to configurations here.
查看项目设置。+
您可以使用一个按钮添加到此处的配置。
回答by ZhangChn
You don't need it.
你不需要它。
Make sure you check the following list before you Archive:
在存档之前,请确保检查以下列表:
In Edit Scheme: Select Release as Build Configuration for Archive,
In Project Build Setting: Set Entitlements.plist and your Distribution code signing for Release scheme,
In Entitlements.plist: Set No to ‘can be debugged'.
在编辑方案中:选择发布作为存档的构建配置,
在项目构建设置中:设置 Entitlements.plist 和发布方案的分发代码签名,
在 Entitlements.plist 中:将 No 设置为“可以调试”。
Then archive and share with your ad-hoc provisioning or submit with distribution provisioning.
然后存档并与您的临时配置共享或与分发配置一起提交。
Hope this is a comprehensive checklist.
希望这是一个全面的清单。
EDIT:
编辑:
to duplicate an existing configuration:
复制现有配置:
回答by tapi
I had a similar issue where I wanted some special behaviour for beta builds
我有一个类似的问题,我想要一些特殊的 Beta 版本行为
These are the steps I took (mostly an expansion of the answer given by @ZhangChn)
这些是我采取的步骤(主要是@ZhangChn 给出的答案的扩展)
- Duplicate the Release Configuration and rename it beta.
- Added a BETA pre-processor macro to the Beta Configuration under build settings.
- Make other changes to your build configuration here.
- Go into manage schemes and duplicate the main scheme for my project and rename it to Beta.
- Edit the new scheme and change the target build configuration to beta (or whatever you named your new build configuration.
- ...
- Profit!!!!
- 复制发布配置并将其重命名为 beta。
- 在构建设置下的 Beta 配置中添加了 BETA 预处理器宏。
- 在此处对您的构建配置进行其他更改。
- 进入管理方案并为我的项目复制主方案并将其重命名为 Beta。
- 编辑新方案并将目标构建配置更改为 beta(或您命名新构建配置的任何名称)。
- ...
- 利润!!!!
Or not, at any rate you should now be able to switch your desired setting simply by changing the scheme you're using instead of mucking about with settings every time.
或者不,无论如何,您现在应该能够通过更改您正在使用的方案而不是每次都乱七八糟的设置来切换您想要的设置。