XCode 5:如何仅构建调试配置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19251661/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:03:28  来源:igfitidea点击:

XCode 5: How to build Debug configuration only

xcodexcode5

提问by deko

It seems that XCode always builds both Debug anв Release configurations (see screenshot attached). I can't untoggle "Profile" option. I need to build Debug version only in 95% of my time. How can I save time by not building Release version every time I press "Build"?

似乎 XCode 总是同时构建 Debug 和 Release 配置(见附上的截图)。我无法取消“个人资料”选项。我只需要在 95% 的时间内构建调试版本。如何通过每次按“构建”时不构建发布版本来节省时间?

enter image description here

在此处输入图片说明

回答by Shebuka

By default, XCode practically always build for Debug, in Release XCode build only when you select from menu Archive or to Profile (shortcut cmd+I) and you see this because when selected you see XCode build your project.

默认情况下,XCode 实际上总是为 Debug 构建,在 Release XCode 构建中,只有当您从菜单 Archive 或 Profile(快捷键cmd+ I)中选择时,您才会看到这一点,因为选择后您会看到 XCode 构建您的项目。

回答by neural5torm

The tab you selected just shows the target(s) (MagicCards1 here) that will be built for each action (Run, Profile, Archive...).

您选择的选项卡仅显示将为每个操作(运行、配置文件、存档...)构建的目标(此处为 MagicCards1)。

Only one build will be made with the appropriate build configuration (Debug, Release, ...) for any given action: your screenshot shows that the 'Debug' configuration will be used to build your target when you run your project, leading me to think that Xcode already does what you're expecting (andthat it'll only compile the source files that changed since the last build).

对于任何给定的操作,只会使用适当的构建配置(调试,发布,...)进行一次构建:您的屏幕截图显示,当您运行项目时,“调试”配置将用于构建您的目标,这导致我认为 Xcode 已经完成了您的期望(并且它只会编译自上次构建以来更改的源文件)。

You can try to compare Debug and Release builds made from scratch by cleaning (Shift+Cmd+K) and building (Cmd+R) with different build configurations in the scheme's Run settings.

您可以尝试通过在方案的运行设置中使用不同的构建配置清理 ( Shift+ Cmd+ K) 和构建 ( Cmd+ R)来比较从头开始构建的调试和发布构建。

You should also check if 'Build Active Architecture Only'is set to Yesand if 'Analyze during Build'is set to Noin your Build Settings: Analyze during Build screenshot

您还应该检查“仅构建活动架构”是否设置为“是”,以及“构建设置中的分析”是否设置为“”: 在构建过程中分析屏幕截图

You may also want to watch this WWDC 2013 video: Xcode Core Concepts 401. Schemes are covered around the 44'-mark.
https://developer.apple.com/videos/wwdc/2013/?include=401#401

您可能还想观看 WWDC 2013 视频:Xcode Core Concepts 401。方案涵盖在 44' 标记附近。
https://developer.apple.com/videos/wwdc/2013/?include=401#401