问题描述
从文档中说出方案:
所以我认为我创建了一个调试方案和一个发布方案,并相应地设置项目和目标的构建设置,即使用发布方案的分发配置文件和调试的开发配置文件。
So I thought I create one debug scheme and one release scheme and set the build settings for Project and targets accordingly, ie using the distribution profiles for release scheme and the develop profile for debug.
但这些设置不当我选择不同的方案时改变。事实上,当我将代码签名设置为分发时,它仍然存在 - 切换到不同的方案不会改变任何内容。
But these settings DO NOT change when I select different schemes. In fact when I set the code signing to distribution it remains - switching to different schemes does not change anything.
非常感谢澄清!
推荐答案
您对构建配置和方案感到困惑。 Xcode项目有两种构建配置:Debug和Release。在构建设置编辑器中,您可以为构建设置提供调试和发布构建配置的不同值。单击构建设置旁边的显示三角形以显示调试和释放配置的值。在您的示例中,您将在构建设置编辑器中找到代码签名标识构建设置。将Code Signing Identity构建设置的值设置为Debug构建配置的开发配置文件,并将其设置为Release构建配置的分发配置文件。
You're confusing build configurations and schemes. Xcode projects have two build configurations: Debug and Release. In the build settings editor, you can give build settings different values for the Debug and Release build configurations. Click the disclosure triangle next to a build setting to show the values for the Debug and Release configurations. In your example you would find the Code Signing Identity build setting in the build settings editor. Set the value of the Code Signing Identity build setting to your develop profile for the Debug build configuration, and set it to the distribution profile for the Release build configuration.
设置后调试和发布构建配置的构建设置,使用方案编辑器选择要使用的构建配置。方案编辑器具有以下操作,您可以在其中选择构建配置:运行,测试,配置文件,分析和存档。 Xcode最初使用Debug配置进行运行,测试和分析,并使用Release配置进行分析和归档。 Run操作是您在开发应用程序时最有可能改变的操作。
After setting the build settings for the Debug and Release build configurations, use the scheme editor to choose the build configuration to use. The scheme editor has the following actions where you can choose the build configuration: Run, Test, Profile, Analyze, and Archive. Xcode initially uses the Debug configuration for running, testing, and analyzing and uses the Release configuration for profiling and archiving. The Run action is the one you're most likely to change over the course of developing your app.
在大多数情况下,您可以使用一个方案。您通常不需要一个Debug方案和一个Release方案。您需要一个Debug和一个Release方案的主要原因是您需要为Debug和Release构建配置运行,测试,配置和分析您的应用程序。
In most cases you can get away with one scheme. You don't normally need one Debug scheme and one Release scheme. The main reason you would need one Debug and one Release scheme is if you needed to run, test, profile, and analyze your app for both the Debug and Release build configurations.
这篇关于理解xCode方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!