使用 iOS 8 测试版打开 iOS 模拟器时出错:“无法启动 iOS 模拟器”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24023029/
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
Error opening iOS Simulator with iOS 8 beta version: "Unable to boot the iOS Simulator"
提问by dayanruben
I recently installed the beta of Xcode Version 6 in OS X Mavericks, with which comes the iOS simulator for iOS 8. I've managed to successfully run from Xcode 6 beta on a device with iOS 8 Beta, but opening the simulator always get the same error I have tried to change the hardware version of iPhone 4s, iPhone 5, ... in the simulator and still gives the same error: "Unable to boot the iOS Simulator".
我最近在 OS X Mavericks 中安装了 Xcode 版本 6 的测试版,其中附带了适用于 iOS 8 的 iOS 模拟器。我设法在装有 iOS 8 Beta 的设备上成功地从 Xcode 6 beta 运行,但打开模拟器总是得到同样的错误我试图在模拟器中更改 iPhone 4s、iPhone 5、...的硬件版本,但仍然出现相同的错误:“无法启动 iOS 模拟器”。
I'm working with Xcode 5.1 at the same time in Mavericks, any suggestion to solve this? Is a possible problem for run this simulator in Mavericks because is only for OS X 10.10? Thanks.
我正在小牛队同时使用 Xcode 5.1,有什么建议可以解决这个问题吗?在 Mavericks 中运行此模拟器是否可能存在问题,因为仅适用于 OS X 10.10?谢谢。
采纳答案by Alexandre
After I found some solutions on the web, a combination of procedures worked for me:
我在网上找到了一些解决方案后,一系列程序对我有用:
Close Xcode and iOS Simulator (and all related applications)
Install (or reinstall) Xcode6-Beta to Applications folder (direct from the .dmg file)
Open Xcode6-Beta and go to Xcode -> Preferences -> Locations -> Command Line Tools and select "Xcode 6.0" (be sure that you've selected the one in Applications folder)
Launch the iOS Simulator and go to iOS Simulator -> Reset Content and Settings...
Close all the applications and restart your mac (I unchecked "Reopen windows...")
Open Xcode6-beta and test the iOS Simulator
关闭 Xcode 和 iOS Simulator(以及所有相关应用程序)
将 Xcode6-Beta 安装(或重新安装)到 Applications 文件夹(直接从 .dmg 文件)
打开 Xcode6-Beta 并转到 Xcode -> Preferences -> Locations -> Command Line Tools 并选择“Xcode 6.0”(确保您已选择 Applications 文件夹中的那个)
启动 iOS 模拟器并转到 iOS 模拟器 -> 重置内容和设置...
关闭所有应用程序并重新启动您的 mac(我取消选中“重新打开窗口...”)
打开 Xcode6-beta 并测试 iOS 模拟器
Good luck
祝你好运
回答by iGW
I also had this problem and found the solution by doing following steps:
我也遇到了这个问题,并通过执行以下步骤找到了解决方案:
Initially i downloaded Xcode 6 library in Documentation section under the path Xcode --> Preferences --> Downloads and restart my xcode but didn't solve my problem.
Downloaded and installed the iOS 7.1 Simulator under the path Xcode --> Preferences --> Downloads. Restart xcode again and the problem solved.
I am facing same issue again next morning. Unsetting the DYLD_INSERT_LIBRARIES variable solves my problem:-
- Open terminal and type "sudo vi /etc/launchd.conf" command and press Enter
Press I "Insert" mode and change this
"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
to this
"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
and press esc to exit from insert mode.
- Save changes by typing ":wq" Press Enter
- Reboot your system and problem soloved.
最初,我在 Xcode --> Preferences --> Downloads 路径下的文档部分下载了 Xcode 6 库,然后重新启动我的 xcode,但没有解决我的问题。
在路径 Xcode --> Preferences --> Downloads 下下载并安装 iOS 7.1 Simulator。再次重启xcode,问题解决。
第二天早上我再次面临同样的问题。取消设置 DYLD_INSERT_LIBRARIES 变量解决了我的问题:-
- 打开终端并输入“sudo vi /etc/launchd.conf”命令并按Enter
按 I“插入”模式并更改此
"setenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
对此
"unsetenv DYLD_INSERT_LIBRARIES /usr/lib/libimckit.dylib"
然后按 esc 退出插入模式。
- 通过键入“:wq”保存更改按 Enter
- 重新启动系统并解决问题。
Prior to that I didn't find any iOS version in front of each listed devices but after installation or by unsetting DYLD_INSERT_LIBRARIES variable I found the same in front of each device.
在此之前,我没有在每个列出的设备前面找到任何 iOS 版本,但在安装或取消设置 DYLD_INSERT_LIBRARIES 变量后,我在每个设备前面找到了相同的版本。
回答by StackRunner
I solved by removing and re-adding the simulators see screenshots here.
我通过删除并重新添加模拟器解决了这里的截图。
回答by Micah
In Xcode go to the Xcode menu->Open Developer Tool - IOS Simulators. Choose simulator and then go hardware->device->manage device.
在 Xcode 中,转到 Xcode 菜单 -> Open Developer Tool - IOS Simulators。选择模拟器,然后去硬件->设备->管理设备。
If the troubled device shows in the left column, delete it. Then add the device back from the '+' button. If it wasn't there in the first place, simply add it using the '+' button.
如果出现问题的设备显示在左栏中,请将其删除。然后从“+”按钮添加设备。如果它首先不存在,只需使用“+”按钮添加它。
回答by username tbd
I don'tbelieve your issue is related to running Xcode 6 in Mavericks, as I encountered the same error on OS X 10.10.
我不相信你的问题涉及到在小牛运行Xcode中6,如我遇到在OS X 10.10相同的错误。
After a bit of toying around with XCode and the iOS Simulator, the only fix I found was simply restarting the computer, and the error hasn't appeared since.
在对 XCode 和 iOS 模拟器进行了一番折腾之后,我发现的唯一解决方法就是重新启动计算机,此后该错误就再也没有出现过。
Try a rebootand then see if you can get things up and running.
尝试重新启动,然后查看是否可以启动并运行。
(On a side note, after restarting just XCode (not the OS), I lost the option to run on the simulator at all—the reboot also fixed this problem, if anyone here encounters anything similar).
(附带说明一下,在仅重新启动 XCode(而不是操作系统)之后,我完全失去了在模拟器上运行的选项——如果有人遇到类似问题,重新启动也解决了这个问题)。
回答by Ru Chern Chong
I had previously deleted ~/Library/Developer/CoreSimulator/
directory and the only command that worked for me is xcrun simctl erase all
. Perhaps you might want to give this a try.
我以前删除了~/Library/Developer/CoreSimulator/
目录,唯一对我有用的命令是xcrun simctl erase all
. 也许您可能想尝试一下。
回答by simon_smiley
I am adding this answer as it seems to be slightly different from the others.
我正在添加这个答案,因为它似乎与其他答案略有不同。
Due to working on an older project I needed to download and run Xcode 7.3 and load the project in simulator - this yielded the "Unable to boot the iOS Simulator" error.
由于处理旧项目,我需要下载并运行 Xcode 7.3 并在模拟器中加载项目 - 这产生了“无法启动 iOS 模拟器”错误。
I completed all the above suggestions and none of them worked (reset simulator setting, restarted, deleted and reinstalled Xcode, reset the simulator location, restarted again etc)
我完成了上述所有建议,但都没有奏效(重置模拟器设置、重新启动、删除并重新安装 Xcode、重置模拟器位置、再次重新启动等)
In the end the issue was that I was trying to load the iPhone 5 (10.0) simulator on Xcode 7.3.
最后的问题是我试图在 Xcode 7.3 上加载 iPhone 5 (10.0) 模拟器。
You can see herethe Apple release notes for Xcode 7.3
您可以在此处查看 Xcode 7.3 的 Apple 发行说明
Xcode 7.3 requires a Mac running OS X 10.11 or later.
Xcode 7.3 includes SDKs for iOS 9.3, watchOS 2.2, OS X version 10.11.4, and tvOS 9.2.
Xcode 7.3 需要运行 OS X 10.11 或更高版本的 Mac。
Xcode 7.3 包括适用于 iOS 9.3、watchOS 2.2、OS X 10.11.4 和 tvOS 9.2 的 SDK。
As you can see Xcode 7.3 doesn't include an SDK for iOS 10.0
如您所见,Xcode 7.3 不包含适用于 iOS 10.0 的 SDK
This meant as soon as I loaded the simulator with iPhone 5 (9.3) it worked immediately.
这意味着一旦我用 iPhone 5 (9.3) 加载模拟器,它就会立即工作。
I would therefore recommend when approaching this issue not to get railroaded (as I did) in thinking that something is wrong with the system before checking the basic things.
因此,我建议在处理此问题时,在检查基本内容之前不要认为系统有问题(就像我所做的那样)。
Note:It is also worth noting that the simulator must be configured to the Xcode version being used. This can be set in
注意:还值得注意的是,模拟器必须配置为正在使用的 Xcode 版本。这可以设置在
Xcode -> Preferences -> Locations -> Command Line Tools
and also using the command line:
并且还使用命令行:
sudo xcode-select --switch /Applications/Xcode_7.3.app/Contents/Developer
*change the Xcode version to the new one you want to use
*将Xcode版本更改为您要使用的新版本
回答by Mani
I've faced same issue and solved by below steps:
我遇到了同样的问题并通过以下步骤解决:
1) Move
xcode6-beta into application folder
1) Move
xcode6-beta 进入应用程序文件夹
2) Restart
mac and open xcode6-beta from application folder.
2) Restart
mac 并从应用程序文件夹中打开 xcode6-beta。
回答by venkatesh
i too had the same issue, but solved by installing the required simulators (Xcode > Preferences> downloads > install simulators)
我也有同样的问题,但通过安装所需的模拟器解决了(Xcode > 首选项 > 下载 > 安装模拟器)
回答by Ric Santos
This happened to me running the simulator on both Xcode 7 and 8 on El Capitan. The only thing that worked was disabling System Integrity Protection (https://apple.stackexchange.com/a/208481/86757).
这发生在我在 El Capitan 的 Xcode 7 和 8 上运行模拟器时。唯一有效的是禁用系统完整性保护 ( https://apple.stackexchange.com/a/208481/86757)。