19
votes

After I run my iPhone project in iPhone Simulator Xcode 4.6 t hangs at the "Running in iPhone 6.1 Simulator" stage every 2nd or 3rd time. Yes, at such regular basis.

It hangs on almost every project I run and on my 2 Mac machines (Mac Mini 8GB, Core 2 Duo, SSD drive and MacBook Pro Core 2 Duo 3,1 Ghz, 8BG RAM, SSD Drive)

This was also the issue in previous Xcode but it has been occurring rarely enough to be tolerable.

I need to restart my Xcode and simulator to be able to run project again (sometimes even restart OS X).

What causes this and what can we do besides restarting Xcode to solve it? Why Apple can't resolve this issue for such a long time?

UPDATE:

I got flagged that this question is unconstructive, with what I do NOT agree as my main and first question was:

What causes this regular hangs? Why Apple has not solved it for such a long time is not my main interest.

Main concern stays very practical and technical: what is the reson of such regular disfunction and is there something developer can do manually to help it?

After all: Xcode is just a tool we use at work and every knowledge which can gain productivity is valuable.

UPDATE 2:

** After reinstalling to the newestMac OS X Lion (clean install) and installing newest Xcode, iTunes, Safari, iPhone Simulator problem persists.** This is clearly Xcode or iPhone simulator bug.

4
For me, it usually helps to manually stop any existing debugging sessions before starting the new one. - Till
Yeah, but when for a first time - you try to fire new session without stopping the new one, Xcode asks you it you want to stop already running session (with "Don't ask again"). So session is stopped anyway automatically before new starts. I am just curious why this has not been improve for such a long time. - Lukasz
Unconstructive. No one here can say why Apple does or doesn't do something. - matt
Not necessarily unconstructive - it may be technical reason for that. There may be general flaw in how debugging session is managed my Xcode and maybe there is something developer should now to help solve it manually (kill some process) - Lukasz
It's a bug in XCode, and a severe one at that. It's driving me crazy. - Warren P

4 Answers

4
votes

I have experienced the same thing many times, often many times a day, not necessarily after a crash. So yes, the bug exists and I've reported it to Apple and have continued to revise the report as data warrants. You should do the same (and provide Apple with a Sample report to show what the threads are doing during the hang each time). This has nothing to do with PLCrashReporter; I can experience this problem with a bare template project. Your question, though, seems unconstructive, as no useful answer can be given. Who can possibly tell you why Apple hasn't fixed it? The only people who can tell you that would be Apple, and you know that they won't tell you. So your question is purely rhetorical. :)

2
votes

I found an fix on a similar post. Make sure that '127.0.0.1 localhost' is in your etc hosts file. This fixed it for me and I had been getting the 'hanging attaching to simulator' issue 100% of the time.

1
votes

I've had the same issues, found that it was related to the newest iTunes since when I unplugged my iPhone target, the color wheel would go away. I've since down rev'd iTunes to 10.7 and the problem is gone. The newer iTunes seem's to get stuck querying the iPhone, and can't progress. I'm running Mac OS X 10.7.5 on an old iMac. I don't have this problem running on a MacBook with 10.8 and the latest iTunes.

1
votes

I have noticed that you can significantly decrease occurrence of this bug by running app on simulator like this:

  • first run on simulator is okay, it won't freeze when uploading app to simulator
  • when you want to re-run the app, make sure to stop the previous execution first by pressing stop (or key cmd+.) and wait 3-5 seconds
  • run the app (cmd+r)

By waiting few seconds after stopping the app it seems to prevent the Xcode execution freeze. I think that the debugger doesn't have enough time to detach and reattach so it hangs.