为 Xcode 项目设置默认方案 [英] Set the default scheme for Xcode project

查看:20
本文介绍了为 Xcode 项目设置默认方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Xcode 项目 MyApp(有 1 个目标 MyApp),其中包括另一个项目 LibProject(有 2 个目标,lib 和 app).我在 Xcode ui 中选择了自动创建方案,当我第一次打开项目时,它确实创建了方案,但选择了嵌套 LibProject 中的方案之一,而我希望选择 MyApp 中的单个目标/方案.我可以事后更改方案并且 UI 会记住,但我不想让 Xcode 默认为不正确的方案.

I have an Xcode project MyApp (with 1 target MyApp), that includes another project LibProject (with 2 targets, lib and app). I have autocreate schemes selected in the Xcode ui, and when I first open the project it does indeed create the schemes but one of the schemes from the nested LibProject is selected whereas I want the single target/scheme from MyApp to be selected. I can change the scheme after the fact and the UI remembers, but I don't want to have Xcode default to an incorrect scheme.

方案最终的顺序:

lib (*with this one selected)
app
MyApp  

知道如何为新创建的方案选择默认值吗?

Any idea how to select the default for newly created schemes?

推荐答案

我正是遇到了这个问题.我们在一个工作区中有三个项目,其中一个依赖于另外两个.为了构建所有东西,我们构建了主项目,但是,在我们切换到 Xcode 6 的时候,在某种程度上,但无法证明,我们拉动时出现的方案将是附属项目之一.即使我们将其更改为主项目,它也会在每次从 git 中拉取时恢复.所以,我知道这不是控制它的用户设置,而是隐藏在一个公共文件中的东西,因为我们的用户设置文件不在我们的 git 存储库中.

I had exactly this problem. We have three projects in one workspace, one of which is dependent on the other two. To build everything, we build the main project, but, somewhat, but not provably, around the time we switched to Xcode 6, the scheme which came up when we pulled would be one of the subsidiary projects. Even if we changed it to the main project, it would revert with every pull from git. So, I knew that this was not a user setting which controlled it, but something hidden in a common file, since our user settings file are not in our git repo.

我设法将它改回我们的工作区.我做了三件事:-

I managed to change it back for our workspace. I did three things:-

首先我在主项目中重新排序了一些文件,以防万一它是一些隐藏的项目设置,但这不起作用;

Firstly I reordered some file in the main project, just in case it was some hidden project setting, but that did not work;

然后我注意到顶级项目被设置为并行构建,所以我将其设置为不这样做,因为它确实需要链接其他两个项目的输出.Xcode 实际上管理得很好,但它是一种强制更改方案文件的方法.这似乎也没有解决它;

Then I noticed that the top-level project was set to build in parallel, so I set that to not do so, since it does require the output of the other two projects to link. Xcode actually manages this fine, but it was a way to force a change in the scheme file. This did not appear to fix it either;

我的第三个变化是删除并重新添加工作区中的子项目;我还颠倒了两个子项目的顺序.这个最终的改变确实让其他用户看到了主要项目的方案,所以我相信这是这样做的方法.

My third change was to delete and re-add the subsidiary projects in the workspace; I also reversed the order of the two subsidiary projects. This final change did make the main project's scheme appear for other users, so I believe is the way to do it.

我列出了其他项目,以防万一事实证明这不仅仅是一步,而且由于早先的尝试,我很幸运.

I listed the other items in case it turns out that this is not just one step and I got lucky due to the earlier attempts.

这篇关于为 Xcode 项目设置默认方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆