Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Xcode 4.3.1 (4E1019) / 4.3.2 (4E2002) hang regularly with iOS simulator? [duplicate]

Once in every 10-20 runs I experience a hanging Xcode when trying to start a new App run in the simulator. The App won't start.

I can quit the simulator, but Xcode will simply ignore quits.

The only solution so far is to kill and restart Xcode. Fortunately that seems to work without side effects.

(xcode 4.3 on Lion, 8GB mac mini, 5.1 iOS)

Edit: I filed a bug report with Apple.

Edit June 2012: it's still a problem in Xcode 4.3.2 (4E2002)

Edit October 2012: with Xcode 4.5 this issue seems to have gone away. I do seem to notice that every run on the simulator now has a pause of a few seconds before starting the application. Perhaps the issue was fixed by introducing a longer wait somewhere. (There is no such thing as a free lunch.)

like image 406
RickJansen Avatar asked Mar 13 '12 13:03

RickJansen


People also ask

Do I need Xcode for iOS simulator?

Launching the Simulator, though, always requires opening Xcode and going to Developer Tools. Because the Simulator. app is embedded within the Xcode app bundle, apps like LaunchBar won't find it to index it.

Does iOS simulator simulate performance?

The simulator does a really lousy job of indicating app performance. In fact it doesn't try. For most things the simulator is much, much faster than an iOS device. It runs your code on an x86 processor, which is much faster than the ARM and has many times more memory.

What is Xcode iOS simulator?

Simulator app, available within Xcode, presents the iPhone, iPad, or Apple Watch user interface in a window on your Mac computer. You interact with Simulator by using the keyboard and the mouse to emulate taps, device rotation, and other user actions. The chapter presents the basics of using Simulator.

How do I enable simulator in Xcode?

Open Xcode and click Menu > Xcode > Preferences > Select Components, and then choose the simulator version you want to download.


2 Answers

Found a workaround that saves you killing Xcode when this happens: if a hang occurs when you are running the iPhone simulator switch to iPad simulator, or vice versa. You will get the message that the simulator is already in use, but ignore that. Then switch back to the device simulator that caused your trouble in the first place, a new run will work!

Perhaps Xcode has trouble contacting the running process in the simulator, above workaround helps.

like image 56
RickJansen Avatar answered Sep 21 '22 16:09

RickJansen


i have found that the hang is harder than all that. can't even get in to switch simulators. Quit Xcode won't work because it doesn't want to stop all tasks. tried killing a zombied clang task, but that didn't work. didn't see either gdb or lldb tasks, though i know clang is associated with lldb.

so ... no answer except force quit xcode or kill -9 xcode processes in terminal.

update … try this https://stackoverflow.com/a/10277189/774691 (which is also referred to by this https://stackoverflow.com/a/13400190/774691 ) ! it's impossible to believe it works, but i use this 2-3 times a day, and i laugh and i laugh and i laugh. it's insane, but it works. vote it up. the guy who came up with that answer needs some serious upvotes!

like image 28
john.k.doe Avatar answered Sep 21 '22 16:09

john.k.doe