使用 Xcode 4 运行发布版本
我看到 Xcode 4 如何在一个视图中很好地分割目标上的信息,但是如何构建和运行这些不同的构建呢?我看到的只是构建和运行的选项,以及这些用于运行、测试和分析的构建选项。不过,我不清楚这些如何映射到构建配置。
I see how Xcode 4 splits the info on your targets nicely in one view, but how does one build and run these different builds? All I see are the options to build and to run, and these options to build for running, testing, and profiling. It's not clear to me how these map to the build configurations, though.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Xcode 4 引入了方案,提供了有关如何构建/运行/配置文件等的所有选项。您的申请。您可以使用项目窗口顶部的
Scheme
下拉按钮更改活动方案和/或通过Product > 编辑方案。编辑方案... ⌘<
菜单项。然后在左侧源列表中,您可以选择Run
项,并在右侧窗格的Info
选项卡中选择使用Release
>构建配置
下拉列表中的配置。Xcode 4 introduces schemes which provide all the options on how to build/run/profile/etc. your application. You can change the active scheme using the
Scheme
drop-down button at the top of the project window and/or edit the scheme viaProduct > Edit Scheme… ⌘<
menu item. Then on the left source list, you can select theRun
item, and in theInfo
tab in the right pane you can choose to use theRelease
configuration in theBuild Configuration
drop-down.在 Xcode 4.3 中 - 转到 Product/Build For 并选择 Archiving。这将编译一个发布版本并将其放置在一个您自己永远找不到的不起眼的文件夹中。到达那里的最快方法是在 Xcode 的项目导航器(在“产品”文件夹中)中选择您的应用程序,右键单击,选择“在 Finder 中显示”。它将带您进入调试版本,但发布版本位于它旁边的文件夹中。
In Xcode 4.3 -- go to Product/Build For and select Archiving. This compiles a release build and places it in an obscure folder which you'll never find on your own. The quickest way to get there is to select your app in Xcode's project navigator (in the Products folder), right-click, select Show in Finder. It will take you to the debug build but the release build is in a folder right next to it.
要添加 Adam Bryzak 答案,您需要在构建设置中激活调试和发布(如果需要,还可以是临时的)。
在项目/构建设置下,搜索预处理器宏并将调试和发布值设置为 1 以激活它们:
,在编辑方案中,当你在DEBUG和release之间切换时,Xcode就会知道他应该改变构建模式。
To add to Adam Bryzak answer, you need to activate the DEBUG and release (and adhoc if needed) in the build settings settings.
Under project/Build settings, search for Preprocessor Macros and set the Debug and release values to 1 in order to activate them:
This way, in the edit schemes, when you switch between DEBUG and release, Xcode will know that he should to change the build mode.