The Simulator can't be launched because it is already in use

╄→尐↘猪︶ㄣ 提交于 2019-12-17 17:54:16

问题


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).

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:

  1. simulator -->services-->a reset content and settings
  2. closing xcode and re-opening
  3. xcode --> developer toos --> simulator -->(open the simulator) quit simulator
  4. Activity monitor --> (the simulator is closed so nothing here to force close)

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.


回答1:


I got the solution..

  1. First of all quit your simulator.
  2. And then quit and restart Xcode.
  3. And then run your project.

I hope it will help you...




回答2:


Restart xcode and the simulator. It's a bug.




回答3:


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.

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.




回答4:


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.

The only solution which I came across, is to make a habit to_

  1. Clean the Project twice or more times

  2. Reset the simulator before running the project.

And the worst part of this solution is to follow this procedure each time before you 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.

Can't help it fellas...

This Bug needs to be resolved by apple, I guess...

2nd September,2014.

I am not facing this problem since i updated my Mac OSX and Xcode. Seems like it is fixed by Apple.

Thanks fellas.




回答5:


Try doing a reset content and settings




回答6:


You just need to close XCode and the iOS Simulator apps. Then restart XCode. That's it.




回答7:


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.

cheers




回答8:


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.




回答9:


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.




回答10:


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.

Make sure that you have installed Xcode properly otherwise Xcode will not work properly.




回答11:


I think it a bug in Xcode 5.1

and i use this solution for this issue. "Close all application from background and then run"

To close application from background use,

Select simulator then press "Ctrl+Shift+H+H" So it open background task screen in this close all application from background and then run your application from Xcode.

i hope this will solve you lots of time of restarting the Xcode.




回答12:


I hav the same problem. My way to slove it is simple: select the correct simulator from simulator's menu->hardware->device. seems the problem is becasue the simulator device didn't fit the scheme device in the xcode project.




回答13:


Check every project window, click "Stop running" button on the top left of XCODE.




回答14:


No need to stop Simulator. * Stop debugging all other projects in Xcode. * Now Run your desired application.

This worked for me.



来源:https://stackoverflow.com/questions/22266953/the-simulator-cant-be-launched-because-it-is-already-in-use

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!