Xcode 4 - 专用配置设置:构建设置和方案定义
我完全迷失了 Xcode 4 的构建设置和方案。
在 Xcode 4 中,您有以下项目:
主项目窗口中的弹出菜单,允许您选择将运行/测试/分析/...的“目标”...
一些构建设置:
方案管理器:
方案编辑器:
使用这些接口,我如何定义许多具有自己的项目构建设置的方案。
我的意思是,今天,无论我做什么,当我在一个方案上更改构建设置时,让我们说“为我调试”,并选择另一个方案让我们说“发布”,构建设置就是我更改的那个。
例如,谈论“RUN”操作,我如何为“在 AppStore 上发布”设置不同的构建设置,为“在我的 iPhone 上发布”设置其他设置,以及为“在调试团队的 iPhone 上调试”设置其他设置。
假设我想在这些配置文件之间更改配置文件、添加/删除一些用户定义的构建设置、更改 iOS 目标以及其他类似的内容?
所有这些设置将应用于所有目标。
或者如果我想要具体目标...
这可以如何完成?
I'm totally lost with Xcode 4 build settings and schemes.
In Xcode 4, you have those items :
A popup menu in the main project window that allow you to choose the "target" you will run/test/analyse/...
Some build settings :
The Scheme manager :
The scheme editor :
Using those interfaces, How may I define many schemes that have their own build settings for the project.
I mean, today, whatever I do, when I change a build setting when on a scheme, let's say "Debug for me", and select another scheme let's say "Release", the build setting is the one I've changed.
For example, talking about the "RUN" action, how can I have different build settings for "Release on the AppStore", some others for "release on my iPhone", and other ones for "Debug on debug team's iPhone".
Let's say I want to change beetween those profiles the provisionning profile, add / remove some user-defined build settings, change the iOS target, and some other stuff like this ?
All those settings would apply to all targets.
Or specific targets if I want...
How does this can be done ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没必要制定那么多计划。即使是一个就足够了。
正如你所看到的,方案编辑器中有“Build、Run、Test、Profile、Analyze、Archive”,这些设置是针对“Product”菜单中它们的操作的。
这意味着,当您单击“Product”菜单中的“Run”时,Xcode 将使用您方案中的“Run”设置。
因此,正如您在屏幕截图中的设置一样,当您直接“运行”您的应用程序时,无论是在 iOS 设备上还是在 iOS 模拟器上,它始终处于调试状态。
另外,当您选择相同的方案并单击“Product”菜单中的“Archive”时,Xcode将自动使用您在该方案中的“Archive”设置,它将是:Release。
最后,关于“调试团队”的事情,我不确定你的意思是什么,但它看起来像是为你的测试团队提供的一些特殊的代码符号配置文件?
在这种情况下,您可以在构建之前更改目标的配置文件设置,或者使用团队配置文件创建新目标。
如果不需要调试,只需“存档”您的应用程序并在使用“组织器”共享您的应用程序时选择您的团队配置文件来签署您的应用程序将非常容易。
已编辑:添加一些屏幕截图以获取帮助
如果您希望对同一操作“运行”有不同的设置,如您所说,您也需要不同的方案。
由于 Xcode 允许您添加不同的构建配置,因此无需创建多个目标。只需“添加”一个新的构建配置,如“Pic1”所示,例如“TeamDebug”。编辑您的目标,为构建配置或您想要设置的内容设置新的配置文件。
然后创建一个新方案并编辑“运行”设置,选择您之前创建的构建配置。
现在您就可以开始了。
PS 在Xcode 4中,使用“Archive”进行构建,在“Organizer”中找到刚刚构建的App,选择“Submit”提交是将您的App发布到App Store的更好方式。或者您也可以选择“分享”将您的App分享给测试团队。
希望这个答案可以帮助您,如果有效,投票或选择它作为正确答案将非常感激。
You don't have to make so many schemes. Even one is enough.
As you can see, there are "Build, Run, Test, Profile, Analyze, Archive" in scheme editor, these settings are for their actions in "Product" menu.
It means, when you clicked "Run" in "Product" menu, Xcode will use your "Run" settings in your scheme.
So, as your settings in your screenshot, when you directly "Run" your App, no matter on iOS Devices or on iOS Simulator, it's always debugging.
Also, when you choose the same scheme and clicked "Archive" in "Product" menu, Xcode will automatically use your "Archive" settings in the scheme, it would be: Release.
Finally, about the "DEBUG TEAM" thing, I am not sure what do your mean, but it looks like some special code sign provisioning file for your test team?
In this situation, you can either change your target's provisioning file setting before building or make a new target using the team provisioning file.
If debug is not required, just "Archive" your App and choose your team provisioning file to sign your App when sharing your App using "Organizer" would be very easy.
Edited: Add some screenshot for help
If you want have different settings for same Action "Run" as you said, you need different scheme as well.
Since Xcode allow you to add different Build Configurations, there is no need to create multiple targets. Just "Add" a new Build Configuration as "Pic1" shown, "TeamDebug" for example. Edit your target to set a new provisioning file for the build configuration or what ever you want to set.
Then create a new scheme and edit your "Run" settings, choose the Build Configuration you've created before.
And you are ready to go.
P.S. In Xcode 4, use "Archive" to build, find the App just builded in "Organizer", choose "Submit" to submit is a better way to release your App to App Store. Or you can also choose "Share" to share your App to the test team.
Hope this Answer can help you out, If it dose, a vote up or choose it as the correct answer would be very appreciated.
如果你想针对不同的场景有不同的构建设置,你想要的是不同的目标。
创建一个定义构建的各种设置的目标。创建目标后,您可以创建使用该目标的方案。
还可以阅读 Xcode 概念 。
If you want to have different build settings for different scenarios, what you want is different targets.
Create a target that defines the various settings for your build. After you create the target, you then create a scheme that uses that target.
Have a read of Xcode Concepts as well.