Xcode 4.2 产品 -> 运行变灰

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8145429/
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 22:26:42  来源:igfitidea点击:

Xcode 4.2 Product -> Run Greyed Out

xcodeios-simulatorappcode

提问by FishStix

My "Run" button under "Product" is greyed out and after trying a few things from various forums, can't figure out what's gone wrong.

我的“产品”下的“运行”按钮是灰色的,在尝试了各种论坛的一些东西后,无法弄清楚出了什么问题。

I've tried removing the project.xcworkspace and xcuserdata files and letting xcode generate new ones, but no...

我已经尝试删除 project.xcworkspace 和 xcuserdata 文件并让 xcode 生成新文件,但没有...

My co-worker uses AppCode from IntelliJ and when he pulls the code, it runs just fine. But if he opens the same files in his Xcode, his "Run" is also greyed out.

我的同事使用 IntelliJ 的 AppCode,当他提取代码时,它运行得很好。但是如果他在他的 Xcode 中打开相同的文件,他的“运行”也会变灰。

采纳答案by FishStix

My co-worker who uses AppCode had edited the configuration file, moved some frameworks around, etc... We noticed that there was a difference between XCode and AppCode in using relative vs. absolute paths in the project.pbxproj file.

我使用 AppCode 的同事编辑了配置文件,移动了一些框架等......我们注意到 XCode 和 AppCode 之间在 project.pbxproj 文件中使用相对路径和绝对路径方面存在差异。

Ultimately I just reverted the code to before his changes, so at this stage, I'm not entirely sure which difference in the config file actually caused Xcode to not be able to Run the project.

最终我只是将代码恢复到他的更改之前,所以在这个阶段,我不完全确定配置文件中的哪个差异实际上导致 Xcode 无法运行项目。

**EDIT From the .git logs, it looks like AppCode was adding relative directories with 7 sets of "/../" and before there were only ever instances of 5 "/../" to get back to the root directory. Rather frustrating that Xcode had no way of dealing with this from inside the IDE.

**编辑从 .git 日志中,看起来 AppCode 正在添加具有 7 组“/../”的相关目录,而之前只有 5 个“/../”的实例返回到根目录。令人沮丧的是,Xcode 无法从 IDE 内部处理这个问题。

回答by chown

"Edit" your current "Scheme":

“编辑”您当前的“方案”:

enter image description here

enter image description here

Make sure you have "Run" checked for that build target:

确保您已为该构建目标选中“运行”:

enter image description here

enter image description here

回答by ShaulF

The scheme need to be fixed (I don't know why xcode changed it)
Here are the required steps:
Goto project, Edit Scheme..., Change executable

该方案需要修复(我不知道为什么 xcode 更改了它)
以下是必需的步骤:
Goto project, Edit Scheme...,Change executable

回答by funroll

Make sure you have the correct target selected.

确保您选择了正确的目标。

(Upper-left in Xcode window, near the triangular Run button.)

(在 Xcode 窗口的左上角,靠近三角形的 Run 按钮。)