ios 模拟器无法启动,因为它已在使用中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22266953/
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
The Simulator can't be launched because it is already in use
提问by Kukula Mula
I'm working with xcode 5, and often get The Simulator can't be launched because it is already in use.
when it's not running or open (i.e. after i do: quit simulator).
我正在使用 xcode 5,并且经常The Simulator can't be launched because it is already in use.
在它没有运行或打开时得到(即在我这样做之后:退出模拟器)。
I stopped the application & don't have any other project that is open, running or using the simulator (please avoid these kind of suggestions).
我停止了应用程序并且没有任何其他打开、运行或使用模拟器的项目(请避免这些建议)。
this happens after i get and exception.
这发生在我得到和异常之后。
how can I "free" the simulator process without having to reboot my computer (right now that is the only solution i found) I've tried:
如何在不必重新启动计算机的情况下“释放”模拟器进程(现在这是我找到的唯一解决方案)我试过:
- simulator -->services-->a reset content and settings
- closing xcode and re-opening
- xcode --> developer toos --> simulator -->(open the simulator) quit simulator
- Activity monitor --> (the simulator is closed so nothing here to force close)
- 模拟器-->服务-->重置内容和设置
- 关闭 xcode 并重新打开
- xcode --> 开发者工具 --> 模拟器 -->(打开模拟器)退出模拟器
- 活动监视器 --> (模拟器已关闭,因此这里没有强制关闭的内容)
also the exception is not getting caught in any of my try catch so i wondering if which tool from the developer instrument can help me figure out what is wrong.
此外,我的任何 try catch 都没有捕获异常,所以我想知道开发人员工具中的哪个工具可以帮助我找出问题所在。
回答by Dharmbir Singh
I got the solution..
我得到了解决方案..
- First of all quit your simulator.
- And then quit and restart Xcode.
- And then run your project.
- 首先退出你的模拟器。
- 然后退出并重新启动Xcode。
- 然后运行你的项目。
I hope it will help you...
我希望它能帮助你...
回答by Patrick Collins
Restart xcode and the simulator. It's a bug.
重新启动 xcode 和模拟器。这是一个错误。
回答by Eagerod
What might be going on here is that you've terminated the simulator, but you haven't actually terminated the debug session that Xcode still has open with the simulator. You'll notice that the stop button still appears in the top left. The debug session remains open because you never continued from the exception you hit.
这里可能发生的情况是您已经终止了模拟器,但实际上并没有终止 Xcode 仍然使用模拟器打开的调试会话。您会注意到停止按钮仍然出现在左上角。调试会话保持打开状态,因为您从未从您遇到的异常中继续。
You'll be able to kill the debug session by pressing the stop button, or by pressing command+period. After that, you'll be able to build to the simulator again.
您可以通过按停止按钮或按命令+句点来终止调试会话。之后,您将能够再次构建到模拟器。
回答by Piyush Mathur
Once we get the error of "Simulator in Use", we will be left with no other option than quitting the Xcode and so the changes made in the code cannot be undone.
一旦我们收到“Simulator in Use”的错误消息,我们将别无选择,只能退出 Xcode,因此在代码中所做的更改无法撤消。
The only solution which I came across, is to make a habit to_
我遇到的唯一解决方案是养成习惯以_
Clean the Project twice or more times
Reset the simulator before running the project.
清洁项目两次或更多次
在运行项目之前重置模拟器。
And the worst part of this solution is to follow this procedure each time beforeyou want to run the project in simulator.
这个解决方案最糟糕的部分是每次在模拟器中运行项目之前都遵循这个过程。
But it does not require to Force Quit Xcode and so this atleast allows us to undo the changes in the code.
但是它不需要强制退出 Xcode,因此这至少允许我们撤消代码中的更改。
Can't help it fellas...
不能帮助它的家伙...
This Bug needs to be resolved by apple, I guess...
这个Bug需要苹果解决,我猜...
2nd September,2014.
2014 年 9 月 2 日。
I am not facing this problem since i updated my Mac OSX and Xcode. Seems like it is fixed by Apple.
自从我更新了 Mac OSX 和 Xcode 以来,我没有遇到这个问题。好像是苹果修复的。
Thanks fellas.
谢谢各位。
回答by diegomercado
You just need to close XCode and the iOS Simulator apps. Then restart XCode. That's it.
您只需要关闭 XCode 和 iOS 模拟器应用程序。然后重新启动 XCode。就是这样。
回答by anuj
Try doing a reset content and settings
尝试重置内容和设置
回答by ralphgabb
You can also fix this by clicking stop button ( next to play button ) on upper left part of xcode. The problem is the simulator is / may be stopped but the debugger is still running on the file. So instead of restarting xcode, just click stop button.
您也可以通过单击 xcode 左上角的停止按钮(播放按钮旁边)来解决此问题。问题是模拟器已/可能已停止,但调试器仍在文件上运行。因此,不要重新启动 xcode,只需单击停止按钮即可。
cheers
干杯
回答by arniotaki
Check if another instance of Xcode uses the simulator. If so just stop the running application by pressing the rectangle on the top left corner of Xcode. It always happens to me because I forget to close the application that is running.
检查 Xcode 的另一个实例是否使用模拟器。如果是这样,只需按下 Xcode 左上角的矩形即可停止正在运行的应用程序。它总是发生在我身上,因为我忘记关闭正在运行的应用程序。
回答by simalone
Check the dock of MacOS, can you find the the simulator icon? Then to check the bottom of the icon whether there is a white line or a white point. If you dock is not at bottom, check the left or right side of the icon whether there is a white line or a white point. If have, the simulator is already in use. You should click on the simulator icon, then press cmd+Q to quite it.
检查MacOS的dock,你能找到模拟器图标吗?然后检查图标底部是否有白线或白点。如果停靠不在底部,请检查图标的左侧或右侧是否有白线或白点。如果有,则模拟器已在使用中。你应该点击模拟器图标,然后按 cmd+Q 来完成它。
回答by Narasimha Nallamsetty
I tried above all but they could not help me to solve my issue. I removed the Xcode and installed it again then the problem is solved.
我首先尝试过,但他们无法帮助我解决我的问题。我删除了Xcode并再次安装它然后问题解决了。
Make sure that you have installed Xcode properly otherwise Xcode will not work properly.
确保您已正确安装 Xcode,否则 Xcode 将无法正常工作。