如何在 Xcode 中选择 iOS 模拟器作为目的地?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12968747/
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
How can I choose an iOS simulator as the destination in Xcode?
提问by bernie2436
I am an iOS noob. I had a project running on the iPhone simulator in Xcode 4.4. To resolve a different issue, I un-installed 4.4 and then installed 4.5.1. Now when I try to run my project on the simulator I get an error "Xcode cannot run using the selected device: No provisioned iOS devices are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination."
我是 iOS 菜鸟。我有一个在 Xcode 4.4 中的 iPhone 模拟器上运行的项目。为了解决另一个问题,我卸载了 4.4,然后安装了 4.5.1。现在,当我尝试在模拟器上运行我的项目时,出现错误“Xcode 无法使用所选设备运行:没有配备兼容 iOS 版本的 iOS 设备可用。将 iOS 设备与最新版本的 iOS 连接以运行您的应用程序或选择 iOS 模拟器作为目标。”
How do I choose an iOS simulator as the destination?
如何选择 iOS 模拟器作为目的地?
Where do I click?
我在哪里点击?
采纳答案by Bergasms
There should be a menu in the top left region of the toolbar section of the IDE. It should have a run button, a stop button, and then the name of your app and a label saying IOS Device. Click view-->show toolbar if you don't see it. Click on IOS Device and you should get a drop down menu of devices. The simulator should be in that list.
IDE 工具栏部分的左上角区域应该有一个菜单。它应该有一个运行按钮,一个停止按钮,然后是你的应用程序的名称和一个写着 IOS 设备的标签。如果没有看到,请单击查看--> 显示工具栏。单击 IOS 设备,您应该会看到一个设备下拉菜单。模拟器应该在该列表中。
回答by David Raijmakers
This should do it, its very simple actually
这个应该可以,其实很简单
回答by jdero
Just in case anyone finds this helpful --
以防万一有人发现这有帮助-
Sometimes your version of xCode doesn't support the deployment targets.
有时您的 xCode 版本不支持部署目标。
My iOS simulator did not show up as a destination until I set the deployment target down to 7.0 (it seems like 7.1 may not be supported by xCode 5.0, but only 5.1 [not confirmed]).
在我将部署目标设置为 7.0 之前,我的 iOS 模拟器没有显示为目的地(似乎 xCode 5.0 可能不支持 7.1,但只有 5.1 [未确认])。
Hope that helps if anyone stumbles across it.
希望如果有人偶然发现它会有所帮助。
回答by Display name
For me the problem was that the selection in the toolbar only shows up for a certain width of the XCode window
对我来说,问题是工具栏中的选择只显示 XCode 窗口的特定宽度
回答by muya_
I was able to add devices to the Simulators list by clicking on Window->Devices
(Shift+Command+2
), and clicking on the +
at the bottom left to add Simulators.
After you click on Create, the device(s) will show up
我可以通过单击Window->Devices
( Shift+Command+2
)将设备添加到模拟器列表,然后单击+
左下角的添加模拟器。单击“创建”后,将显示设备
回答by Trekker
I had the same issue. The simulator would run a different device than chosen in the size field under "Simulated Matrix".
我遇到过同样的问题。模拟器将运行与“模拟矩阵”下的大小字段中选择的设备不同的设备。
I dug around and found in Xcode's menu: Product/Destination. screenshotI was then able to run the simulator for the correct size.
我在 Xcode 的菜单中找到了:Product/Destination。屏幕截图然后我能够以正确的大小运行模拟器。
Hope this helps !!
希望这可以帮助 !!