xcode IOS模拟器找不到sdk和模拟应用退出错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11092452/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:37:59  来源:igfitidea点击:

IOS Simulator cannot find sdk and the simulated application quit errors

xcodesdksimulatorquit

提问by Matt Schaub

I have been having this Xcode problem for a couple of months where my iOS simulator stops working whenever i run any application on Xcode and says, "The simulated application quit." and "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." I am running Xcode 4.3.3 and have iOS sdk 5.1 and everything updated but it happened on my previous version of Xcode also. I have tried reinstalling Xcode over 10 times now and have been posting this question for a while now. No one has been able to get a solution. I have even sent in a bug report to apple but i don't think they will respond. I have tried doing everything every other person that has this problem has been told to do in other threads. I'm honestly thinking about just buying a new mac and seeing if Xcode will work on that one or taking in my current one to get looked at by apple. So if anyone has any ideas please let me know.

几个月来,我一直遇到这个 Xcode 问题,每当我在 Xcode 上运行任何应用程序时,我的 iOS 模拟器就会停止工作,并说“模拟的应用程序退出了”。和“iOS Simulator 找不到 SDK。SDK 可能需要重新安装。” 我正在运行 Xcode 4.3.3 并且有 iOS sdk 5.1 和所有更新,但它也发生在我以前版本的 Xcode 上。我已经尝试重新安装 Xcode 超过 10 次,并且已经发布这个问题一段时间了。没有人能够得到解决方案。我什至向苹果发送了错误报告,但我认为他们不会回应。我已经尝试在其他线程中执行所有其他遇到此问题的人被告知要做的所有事情。一世' 老实说,我正在考虑购买一台新的 mac,看看 Xcode 是否可以在那个上运行,或者将我当前的 mac 拿来让苹果查看。所以如果有人有任何想法,请告诉我。

回答by Axle

Go to Xcode -> Preferences -> Downloads and make sure the "Target SDK" you have selected in your project is in fact installed under the Downloads windows. For me this magically was uninstalled. Once i installed the SDK that my app was using, all worked again

转到 Xcode -> Preferences -> Downloads 并确保您在项目中选择的“Target SDK”实际上已安装在“下载”窗口下。对我来说,这神奇地被卸载了。一旦我安装了我的应用程序正在使用的 SDK,一切都会再次运行

回答by ste8

This worked for me: http://www.colinbowern.com/posts/the-simulated-application-quitI just deleted the folder "6.1" under ~/Library/Application Support/iPhone Simulator The I just launched again the app and the simulator recreated correctly the 6.1 folder.

这对我有用:http: //www.colinbowern.com/posts/the-simulated-application-quit我刚刚删除了 ~/Library/Application Support/iPhone Simulator 下的文件夹“6.1”我刚刚再次启动了该应用程序和模拟器正确地重新创建了 6.1 文件夹。

回答by septerr

Resetting the simulator settings (iOS Simulator > Reset Contents and Settings) resolved this issue for me.

重置模拟器设置(iOS Simulator > Reset Contents and Settings)为我解决了这个问题。

回答by Khawar Ali

I have personally experienced a weird thing with xcode regarding this issue. Sometimes the sdk is installed properly but it still gives this error. I have two classes, if I call first class from the app delegate then the ipad simulator works fine but when I call the second class then it gives the error that the sdk needs to be re-installed. In my case when the error occured, I had two errors in the second class. When I corrected the errors after debugging, the ipad simulator started to work completely fine. This is quite weird but its not the problem with your sdk, the problem is somewhere in the code.

关于这个问题,我个人在 xcode 上遇到过一件奇怪的事情。有时 sdk 已正确安装,但仍会出现此错误。我有两个类,如果我从应用程序委托调用第一个类,那么 ipad 模拟器工作正常,但是当我调用第二个类时,它会给出需要重新安装 sdk 的错误。在我发生错误的情况下,我在第二堂课中有两个错误。当我在调试后更正错误时,ipad 模拟器开始完全正常工作。这很奇怪,但这不是你的 sdk 的问题,问题出在代码的某个地方。

回答by Josh

This just happened to me. I tried to launch with iPhone 5.1 Simulator, got the error "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." I tried running iPad 5.1 Sim, which worked. I switched to non-retina iPad. Then I tried running iPhone 5.1 Simulator again, and it worked.

这只是发生在我身上。我尝试使用 iPhone 5.1 Simulator 启动,收到错误“iOS Simulator 找不到 SDK。可能需要重新安装 SDK。” 我尝试运行 iPad 5.1 Sim,它奏效了。我切换到非视网膜 iPad。然后我再次尝试运行 iPhone 5.1 Simulator,它奏效了。

回答by Denis Balko

I had the same issue. For me suddenly all the installed simulators (4.3 through to 6.0) stopped working. I then went to Xcode -> Preferences -> Downloads, and there I had the chance to update at least the 5.0 simulator. This is now working, yet I was not able to get the 4.3 or 5.1 or 6.0 to work.

我遇到过同样的问题。对我来说,所有已安装的模拟器(4.3 到 6.0)突然停止工作。然后我转到 Xcode -> Preferences -> Downloads,在那里我有机会至少更新 5.0 模拟器。这是现在工作,但我无法让 4.3 或 5.1 或 6.0 工作。