XCode 7. iOS 模拟器丢失且无法安装
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31551480/
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
XCode 7. iOS simulators missing and not installable
提问by Alexey Bondarchuk
- Can't see any iOS 9.0 simulators. In previous Xcode 7 beta 3 all was OK.
- Can't install iOS 8.3 simulator.
- 看不到任何 iOS 9.0 模拟器。在之前的 Xcode 7 beta 3 中一切正常。
- 无法安装 iOS 8.3 模拟器。
- Also I can't add any simulator from 'Organizer'. By pressing "Create" nothing happened.
- 此外,我无法从“组织者”添加任何模拟器。按“创建”什么也没发生。
- Each time when I'm trying to download iOS simulator I see next thing:
- 每次当我尝试下载 iOS 模拟器时,我都会看到下一件事:
回答by Arkku
One possible issue is that there may be old leftover simulators installed, which are not compatible with the new XCode, and their presence causes the whole Simulator to fail. To get rid of them, delete the simulators in /Library/Developer/CoreSimulator/Profiles/Runtimes
(for me there was an iOS 7 simulator there which was the issue). Relaunch XCode after this.
一个可能的问题是可能安装了旧的剩余模拟器,它们与新的 XCode 不兼容,它们的存在会导致整个模拟器失败。要摆脱它们,请删除模拟器/Library/Developer/CoreSimulator/Profiles/Runtimes
(对我来说,那里有一个 iOS 7 模拟器,这是问题所在)。在此之后重新启动 XCode。
Then try to run the simulator from XCode->Open Developer Tool->Simulator
. Assuming this succeeds, verify that you have the simulators under the iOS Simulator menu Hardware->Device->Manage Devices…
– if not, you should be able to click the +
in the bottom bar to add yourself some iOS 9 simulators. Relaunch XCode again and they should show up in the menu.
然后尝试从XCode->Open Developer Tool->Simulator
. 假设这成功了,请确认您在 iOS Simulator 菜单下有模拟器Hardware->Device->Manage Devices…
——如果没有,您应该能够单击+
底部栏中的 来添加自己的一些 iOS 9 模拟器。再次重新启动 XCode,它们应该会出现在菜单中。
回答by Javier Calatrava Llavería
回答by Emin Israfil iOS
回答by aToz
For me it was only showing one simulator,
and when I go to Xcode > Preferences
I can see the simulator is already downloaded but it is not showing up in the list,
当我去时,Xcode > Preferences
我可以看到模拟器已经下载,但它没有出现在列表中,
if you're facing something similar. This is how you should add required simulator,
如果你面临类似的事情。这是你应该如何添加所需的模拟器,
From the Xcode menu, open Windows > Devices
, shown in the image below
从 Xcode 菜单中,打开Windows > Devices
,如下图所示
you should see this screen,
你应该看到这个画面
notice there is only one simulator (ref: first image)
注意只有一个模拟器(参考:第一张图片)
Now to add required simulator, you should click on the + (in the left corner)
现在要添加所需的模拟器,您应该单击 +(在左角)
You should see this,
你应该看到这个,
You can choose the simulator from the list, In my case it is iPhone 6s Plus
.
您可以从列表中选择模拟器,就我而言,它是iPhone 6s Plus
.
In Xcode
you can see additional simulator iPhone 6s Plus
,
在Xcode
你可以看到额外的模拟器iPhone 6s Plus
,
回答by Amit Ajmera
I was also not able to see simulators.Reason is,I have not restarted system after upgrading Xcode.I restarted & simulator started displaying as routine.
我也看不到模拟器。原因是,升级 Xcode 后我没有重新启动系统。我重新启动 & 模拟器开始显示为例行程序。
回答by Farshid
If simulators are suddenly disappeared:
如果模拟器突然消失:
Just consider decreasing Deployment target to a minor version below current version in Project > Build Settings > Deployment Info > Deployment Target
只需考虑将部署目标降低到低于当前版本的次要版本 Project > Build Settings > Deployment Info > Deployment Target
P.S. Usually you see a place holder text showing the selected version (in gray) in the box denoted above. If for example the gray text says 9.3, then decrease it to 9.2.
PS 通常,您会在上面指示的框中看到显示所选版本(灰色)的占位符文本。例如,如果灰色文本显示 9.3,则将其减少到 9.2。
回答by Jeremy Huddleston Sequoia
There is a bug in the latest El Capitan beta which causes a process to crash when dlopen() fails to mmap() a dynamic library. Such mmap() failures can occur due to code signature verification failures.
最新的 El Capitan 测试版中存在一个错误,当 dlopen() 无法 mmap() 动态库时,该错误会导致进程崩溃。由于代码签名验证失败,可能会发生此类 mmap() 失败。
These mmap() failures will occur if older iOS Simulator runtimes are present on disk (ie: installed from Xcode 6.x), and that is the reason why Xcode 7 beta release notes have indicated that earlier runtimes are not working in Xcode 7. The iOS 8.x Simulator runtimes were updated in newer downloads, but if the older versions are present on disk, they will cause the mmap() failure, which in the latest El Capitan beta, unfortunately results in the CoreSimulatorService repeatedly crashing which in turn results in no simulators being available.
如果磁盘上存在较旧的 iOS 模拟器运行时(即:从 Xcode 6.x 安装),则会发生这些 mmap() 故障,这就是为什么 Xcode 7 beta 发行说明指出较早的运行时在 Xcode 7 中不起作用的原因。 iOS 8.x Simulator 运行时在较新的下载中进行了更新,但如果磁盘上存在旧版本,它们将导致 mmap() 失败,在最新的 El Capitan beta 中,不幸的是导致 CoreSimulatorService 反复崩溃,进而导致导致没有可用的模拟器。
回答by Tyler Hostager
Look at seancook's response in the middle of this page... it seems to have fixed this issue for several people.
看看本页中间 seancook 的回复……似乎已经为好几个人解决了这个问题。
https://forums.developer.apple.com/thread/11706
https://forums.developer.apple.com/thread/11706
Edit: This can also be fixed by booting into recovery mode (CMD - R) and reinstalling El Capitan.
编辑:这也可以通过启动进入恢复模式(CMD - R)并重新安装 El Capitan 来解决。
回答by SimranChahal
Go to Windows. Select Devices. Select '+' from left bottom and add all simulators one by one.
转到 Windows。选择设备。选择左下角的“+”,将所有模拟器一一添加。
回答by nyxee
I had changed the name of my Project from Finder. I clicked on the old project name (between the Play Button and and the selector for the desired Simulator or Device), selected edit schemes, selected the Targets Tab, and realised that the old scheme was missing so I just added my new Project name by clicking on the plus button and the simulator list reappeared.
我已经从 Finder 更改了我的项目名称。我点击了旧项目名称(在播放按钮和所需模拟器或设备的选择器之间),选择了编辑方案,选择了目标选项卡,并意识到旧方案丢失了,所以我只是添加了我的新项目名称单击加号按钮,模拟器列表重新出现。