X code能建立一个项目,但不能在模拟器上运行它 [英] Xcode can build a project but can't run it on simulator

查看:250
本文介绍了X code能建立一个项目,但不能在模拟器上运行它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从网络上下载的一个项目,有时可以建,但不运行(X code - >产品 - >运行被禁止,灰色)。当我创建自己的项目这从未发生过。可能是什么问题?它是用某种方式连接的版本?
我是新的iOS开发和下载项目从网络用于研究目的。很遗憾没有能够测试他们的模拟器。

When I download a project from the web, sometimes it can be built but doesn't run (XCode -> Product -> Run is disabled, in grey). This never happens when I create projects myself. What could be the problem? Is it somehow connected with version? I'm new to iOS development and download projects from the web for studying purposes. It's a pity not to be able to test them on the simulator.

推荐答案

一般来说,如果你不能运行的项目,无论是:

Generally, if you can't Run a project, either:


  • 它不必知道如何跑构建方案。检查顶部旁边的运行/停止按钮,还有一个显示配置文件名称和目标设备。如果框显示没有计划然后点击它并创建一个新方案。如果有一个方案,请单击下拉菜单(在X code 4.2+左侧分隔,包装盒上的任何地方,否则),去编辑计划,以确保该计划正确设置运行

  • It doesn't have a build scheme that knows how to "run". Check at the top next to the Run/Stop buttons that there's a profile name and target device shown. If the box says No Scheme then click on it and create a New Scheme. If there IS a scheme, click on the drop-down menu (left divider in Xcode 4.2+, anywhere on the box otherwise) and go to Edit Scheme to make sure the scheme was set up correctly for Running

它没有一个构建配置集即可。你应该在你构建方案的运行部分看到这一点。检查有一个选定的。如果该列表是空的,去的项目图标左边面板顶部,选择项目,进入信息部分,并创建一个构建配置,虽然应该已经有至少一个,如果你可以建立项目

It doesn't have a build configuration set. You should see this in the Run section of your build scheme. Check there's one selected. If the list is empty, go to the Project icon at the top of the leftmost pane, select the Project, go into the Info section, and create a build configuration, although there should already be at least one if you can build the project

它不必在所有,这可能意味着你已经得到其编译为静态库或框架,在其他项目中使用的一个项目运行的目标。如果是这种情况,你应该看到图标为您构建目标为黄色工具箱(框架),或一个小的白色建筑(一个图书馆,但对我来说,它看起来更像是<一个href=\"https://upload.wikimedia.org/wikipedia/commons/4/48/Oblique_facade_3,_US_Su$p$pme_Court.jpg\">United美素preME苑大厦)。

It doesn't have a runnable target at all, which might mean you've got a project which compiles to a static library or framework for use in OTHER projects. If this is the case, you should see the icon for your build Target as a yellow toolbox (framework), or a little white building (a "library", although to me it looks more like the United States Supreme Court Building).

的目标是无效的模拟器,这意味着你可能需要添加 386 架构的和的有效架构的之前,你可以运行它的目标

The target isn't valid for the Simulator, which means you might need to add i386 to the list of Architectures and Valid Architectures on the Target before you can run it

的目标是无效的当前连接的设备即可。对于这一个,检查设定的部署目标数回足以成为有效的设备的版本的iOS

The target isn't valid for the currently connected device. For this one, check the Deployment Target number is set back enough to be valid for the device's version of iOS

X code不能看到连接的设备即可。尝试拔出并插回如果仍然不承认它,你可能还没有把它添加到X $ C $角(窗口 - >设备 - >选择设备 - >用于开发)

Xcode can't see the connected device. Try unplugging and plugging it back in. If it still doesn't recognize it, you may have not added it to Xcode (Window -> Devices -> Select the device -> Use for Development)

这篇关于X code能建立一个项目,但不能在模拟器上运行它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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