Xcode 错误连接到模拟器“软件导致连接中止”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43527115/
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 error connecting to simulator "Software caused connection abort"
提问by Hannele
When I try to run my project through the Xcode simulator, it keeps giving me the error "Software caused connection abort".
当我尝试通过 Xcode 模拟器运行我的项目时,它不断给我错误“软件导致连接中止”。
Tried restarting the simulator & Xcode, and I recently deleted the DerivedData folder as suggested in this post about broken playgroundsso that also didn't help.
尝试重新启动模拟器和 Xcode,我最近删除了 DerivedData 文件夹,正如这篇关于损坏的操场的帖子中所建议的那样,这也无济于事。
回答by Gabriel Goncalves
QUICK FIX
快速解决
This is happening because you have multiple versions of Xcode installed. MacOS unfortunately only supports running one version of Xcode at a time, and it needs to know the location of the currently running version. To sort things out, choose one of the following:
发生这种情况是因为您安装了多个版本的 Xcode。遗憾的是,MacOS 一次只支持运行一个版本的 Xcode,它需要知道当前运行版本的位置。要解决问题,请选择以下选项之一:
Quit all instances of Xcode and restart it
退出 Xcode 的所有实例并重新启动它
Try one of the other options below if that hasn't solved it.
如果还没有解决它,请尝试下面的其他选项之一。
Using the command line:
使用命令行:
run
sudo xcode-select --switch /Applications/your_custom_folder_if_needed/Xcode.app
Restart your terminal and Xcode and it will work just fine.
跑
sudo xcode-select --switch /Applications/your_custom_folder_if_needed/Xcode.app
重新启动您的终端和 Xcode,它会正常工作。
No-command line users:
无命令行用户:
- Quit all instances of Xcode
- Start the instance of Xcode that you want to use
- Go to Xcode -> Preferences -> Locations
- Select the correct version in Command Line Tools
- Done!
- 退出所有 Xcode 实例
- 启动要使用的 Xcode 实例
- 转到 Xcode -> 首选项 -> 位置
- 在命令行工具中选择正确的版本
- 完毕!
回答by Umit Kaya
It's due to multiple Xcodeinstalled in your system. This is how you make it work:
这是由于您的系统中安装了多个 Xcode。这是你让它工作的方式:
- Quit all running Xcodes
- Re-launch Xcode
- Go to Xcode > Preferences > Locations
- Change to the correct version in
Command Line Tools
- 退出所有正在运行的 Xcode
- 重新启动Xcode
- 转到 Xcode > 首选项 > 位置
- 更改为正确的版本
Command Line Tools
Clean project and clear Derived data if necessary, then run!
如有必要,清理项目并清除派生数据,然后运行!
回答by Chuck Boris
In my case quitting and re-launching given Xcode was enough. I had two Xcodes, stable and beta.
在我的情况下,退出并重新启动 Xcode 就足够了。我有两个 Xcode,稳定版和测试版。
回答by Deepak
For me, restarting the Mac OS worked (multiple times).
对我来说,重新启动 Mac OS 有效(多次)。