Xcode 不在模拟器上运行该应用程序。(应用程序意外退出)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20480607/
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 does not run the app on simulator. (App exited unexpectedly)
提问by eestein
I'm developing for iPad (iOS 7), using Xcode 5.0.2. Yesterday morning I was playing around with the app (my first app) and every time I ran it, it was displayed in the emulator perfectly. But after some 5/6 runs Xcode just stopped launching my app in the simulator. I started to receive this message:
我正在为 iPad (iOS 7) 开发,使用 Xcode 5.0.2。昨天早上我正在玩这个应用程序(我的第一个应用程序),每次运行它时,它都完美地显示在模拟器中。但是在运行了 5/6 次之后,Xcode 就停止在模拟器中启动我的应用程序。我开始收到这条消息:
MagazineManager exited unexpectedly - lost connection
MagazineManager 意外退出 - 失去连接
Image:
图片:
I've been researching since yesterday morning for a solution with no luck. I even uninstalled and reinstalled Xcode, cleared the cache, delete folders... all that drama thinking it could be some sort of cache problem.
从昨天早上开始,我一直在研究一个没有运气的解决方案。我什至卸载并重新安装了 Xcode,清除缓存,删除文件夹......所有这些戏剧性的想法都认为这可能是某种缓存问题。
Then, going online I've tried lots of "solutions", none worked.
然后,上网我尝试了很多“解决方案”,都没有奏效。
I've tried all listed here: Xcode suddenly stopped running project on hardware: "Could not launch xxx.app: .. No such file.."
我已经尝试了这里列出的所有内容:Xcode 突然停止在硬件上运行项目:“无法启动 xxx.app:.. 没有这样的文件..”
and here:https://discussions.apple.com/message/23431537#23431537
在这里:https: //discussions.apple.com/message/23431537#23431537
and in more places.
并在更多地方。
After all my "try this, try that" I'm stuck with the same problem. I can only see a black screen at the simulator (image below) and that message at Xcode!
毕竟我的“试试这个,试试那个”我被同样的问题困住了。我只能在模拟器上看到黑屏(下图),在 Xcode 上看到这条消息!
In my extensive research I've read that people are still able to debug using their iPad's. The problem is that I got the new iPad air, that's only getting here dec, 20th!! So I don't have a place to test my app[s].
在我广泛的研究中,我读到人们仍然可以使用他们的 iPad 进行调试。问题是我得到了新的 iPad air,那是 12 月 20 日才到的!!所以我没有地方来测试我的应用程序[s]。
Thanks!
谢谢!
UPDATE
更新
Just got this message in the debugger console:
刚刚在调试器控制台中收到此消息:
013-12-09 20:23:25.902 sim[607:303] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin/sim: Did not find an executable file at the path: '/Users//Library/Developer/Xcode/DerivedData/MagMan-bvhhiijesvrvuteunbmpsxcqgsst/Build/Products/Debug-iphonesimulator/MagMan.app'
013-12-09 20:23:25.902 sim[607:303]/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin/sim:在路径中没有找到可执行文件:' /Users//Library/Developer/Xcode/DerivedData/MagMan-bvhhiijesvrvuteunbmpsxcqgsst/Build/Products/Debug-iphonesimulator/MagMan.app'
回答by eestein
My problem was the debugger. Actually, it still is. The way I solved, and have been doing for every new project, was to disable the debugger and then run the project. That way I'm able to use the app on the simulator but without the debugging functionality.
我的问题是调试器。事实上,它仍然是。我解决的方法,并且一直在为每个新项目做,是禁用调试器,然后运行项目。这样我就可以在模拟器上使用该应用程序,但没有调试功能。
I don't know what the problem is, what is causing this debugger issue in my case, but for now that's the best I could come up with. Thanks to the friends that replied to my question and helped my research I was able to test it and disable it.
我不知道问题是什么,在我的情况下是什么导致了这个调试器问题,但现在这是我能想到的最好的方法。感谢回答我的问题并帮助我研究的朋友,我能够测试它并禁用它。
This is how I disabled the debugger:
这就是我禁用调试器的方式:
- Project > Edit scheme
- Set
Debugger
to None
- 项目 > 编辑方案
- 设置
Debugger
为无
If anyone knows a solution for this, feel free to answer this question and I'll make sure to update the selected answer accordingly.
如果有人知道此问题的解决方案,请随时回答此问题,我会确保相应地更新所选答案。
Again, thanks for all your time and patience, specially @Popeye and @HotLicks that spent a lot of their time trying to help me.
再次感谢您的所有时间和耐心,特别是 @Popeye 和 @HotLicks,他们花了很多时间来帮助我。
回答by Popeye
Sometimes the simulator can be a bit flaky and just needs resetting. In the navigation bar at the top of the screen when the simulator is visible try:
有时模拟器可能有点不稳定,只需要重置。当模拟器可见时,在屏幕顶部的导航栏中尝试:
iOS Simulator --> Reset Content and Settings...
This should reset all the settings and remove the content so all data, images, apps etc will be removed, its like it has never run before.
这应该重置所有设置并删除内容,以便删除所有数据、图像、应用程序等,就像它以前从未运行过一样。
UPDATE
更新
The answer on XCode5 can't install app on iOS simulatorindicates the following
XCode5 无法在 iOS 模拟器上安装应用程序的答案表明以下内容
I found a "Fix" for this. After trying everything and getting the same error on "My App", I opened and tried to run "My App 2". "My App 2" ran fine, so I went back to "My App", tried again and this time everything worked fine. Crazy
我为此找到了“修复”。在尝试了所有内容并在“我的应用程序”上遇到相同的错误后,我打开并尝试运行“我的应用程序 2”。“我的应用程序 2”运行良好,所以我回到“我的应用程序”,再次尝试,这次一切正常。疯狂的
If that doesn't work leave a comment and I will have another look.
如果这不起作用,请发表评论,我再看看。
回答by DineshKumar
Delete the app and restart your iPad it will work
删除应用程序并重新启动您的 iPad 它将起作用