使用 Xcode 4运行发布版本

我看到 Xcode 4如何在一个视图中很好地分割目标的信息,但是如何构建和运行这些不同的构建呢?我所看到的只是要构建和运行的选项,以及要构建用于运行、测试和分析的选项。但是我不清楚这些如何映射到构建配置。

56837 次浏览

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 via Product > Edit Scheme… ⌘< menu item. Then on the left source list, you can select the Run item, and in the Info tab in the right pane you can choose to use the Release configuration in the Build Configuration drop-down.

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:

enter image description here

This way, in the edit schemes, when you switch between DEBUG and release, Xcode will know that he should to change the build mode.

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.