当我分支我的项目时,iOS 方案丢失(Xcode 4.2)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9950259/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:50:31  来源:igfitidea点击:

iOS scheme goes missing when I branch my project (Xcode 4.2)

iosxcodexcode4xcode4.2

提问by spring

In Xcode 4.2 when I create a new branch and open it, the iOS scheme which exists in the Master is lost. Instead I have a scheme for 'Mac 64 bit."

在 Xcode 4.2 中,当我创建一个新分支并打开它时,Master 中存在的 iOS 方案丢失了。相反,我有一个“Mac 64 位”的方案。

This has happened a few times in a row and I handle it by creating a new scheme, deleting the 'Mac 64 bit' one and then renaming the new scheme to what the original was. I'd rather fix whatever is wrong though. Did I set something up wrong - some preference somewhere?

这种情况连续发生了几次,我通过创建一个新方案来处理它,删除“Mac 64 位”方案,然后将新方案重命名为原始方案。不过,我宁愿修复任何错误。我是否设置错误 - 某处的某些偏好?

回答by Imju

I know this is old question but there doesn't seem to be a good question lately either. So, I am adding my solution for this.

我知道这是个老问题,但最近似乎也没有什么好问题。所以,我为此添加了我的解决方案。

The issue is because the scheme is not checked into other branch. If they are not, scheme will disappear on others.

问题是因为该计划未签入其他分支。如果他们不是,计划将在其他人身上消失。

If you wonder why this was not checked in, scheme is local unless you 'Check to Share' box in Manage Schemeand source controlled to git.

如果您想知道为什么没有签入,方案是本地的,除非您在管理方案选中检查共享”框并且源控制为 git。

After it is saved in a branch, to make this change visible in other branches, you need to propagate this to the rest of working branches.

将其保存在分支中后,要使此更改在其他分支中可见,您需要将其传播到其余的工作分支。

I did this using git command line because doing this xcode isn't so reliable because it is under .xcodeproj.

我使用 git 命令行执行此操作,因为执行此 xcode 不太可靠,因为它位于 .xcodeproj 下。

回答by Franck Mamboue

I ran into the same issue and this is how I fixed it:

我遇到了同样的问题,这就是我解决它的方法:

  • From my master branch, I exported the schemes I needed - I did by navigating to Product > Scheme > Manage Schemes...on the Xcode menu. I then selected the schemes I wanted to export (i.e. Developmentand Releasein my case). Finally, I chose the Export...option after clicking on the gear icon as shown in the picture below.
  • 从我的主分支,我导出了我需要的方案——我是通过导航到Product > Scheme > Manage Schemes...Xcode 菜单上的。然后我选择,我想出口(即方案Development,并Release在我的情况)。最后,我Export...在单击齿轮图标后选择了该选项,如下图所示。

Manage Scheme

管理方案

  • Then I switched to my branch and followed the same steps as before but choosing importinstead of export. And voila
  • 然后我切换到我的分支并按照与以前相同的步骤进行操作,但选择importexport. 瞧

Hope it helps! Cheers

希望能帮助到你!干杯