Launching simulator freezes whole Mac

I have a 2019 16 inch MacBook Pro running Catalina 10.15.5 with a strange problem. Just launching the Simulator can hard freeze the entire machine. The Simulator launches, the device shows a spinner that just keeps going and within a couple of seconds the machine beach-balls and the entire UI freezes with no possibility of option-command-escape to kill the Simulator.

I've looked in the logs afterward and I don't see any good clues. This problem is much more likely to occur with a simulated iPhone device (much more rare with a simulated iPad) and it doesn't happen every time I launch a simulated iPhone, just somewhere between 1/3 and 1/2 of the time.

Does anyone have any debugging or diagnostic ideas?

Thanks!

Replies

Can you try running sudo spindump 100 -o ~/spindump.txt first, then boot an iPhone simulator?

Once that finishes please attach the spindump and a sysdiagnose to a feedback report and reply with it here. If you leave the machine alone for 5-10 minutes and it still doesn't recover then reboot and you should see the spindump.txt file still on disk. Then take a sysdiagnose and attach both.

I'll take a look to see if we can figure out what is going wrong.


If you aren't able to get the machine to successfully write a spindump when this happens then we can take a look at an NMI to generate a kernel core dump but let's try the easier and simpler things first. If that does happen then it leads me to suspect a hardware problem of some kind.
Thanks so much for your response! I upgraded to Xcode 11.6 this morning and now when trying to get a freeze, I'm not getting one, even when I stop doing my workarounds to minimize the problem (I found disabling "Parallelize Build", never using the Previews, setting the Simulator to prefer the Integrated GPU, and always opening the Simulator before Xcode helped). Maybe there was a fix in Xcode 11.6?

In case it does start freezing again - one question: if I run sudo spindump 100 -o ~/spindump.txt first, I get an error message:

Code Block
perdue@mac-135246 ~ % sudo spindump 100 -o ~/spindump.txt
Cannot find process with pid or partial name 100


I can run "Spindump" from Activity Monitor, but when the system freezes, I can't access Activity Monitor. How do I get a "pre-emptive" spindump?

Thanks again!
For what it's worth, the problem has resurfaced, but it does seem to be tied to what else the machine is doing, and it is still sort of random. So I'm not quite sure how to get a pre-emptive spin dump...

Thanks!
What you want here is a sysdiagnose log, and you can trigger that via a key chord. I don’t remember the exact chord but I’m pretty sure it’s in the sysdiagnose for macOS instructions on our Bug Reporting \> Profiles and Logs page.

There’s no guarantee that the key chord will work — it kinda depends on how badly wedged your Mac is — but it’s the best place to start. Let us know how you get along.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Just to close this off, the problem went away after one of the OS point upgrades. I had built a workflow that carefully went around this, so I'm not sure when it happened.

This has been happening to me for several months, both on Catalina and now on Monterey (I'm on macOS 12.2 with Xcode 13.2.1). And for me, it happens almost 100% of the time. Back in November, I wiped and reinstalled macOS entirely, which seemed to fix my problem for about a month and a half before it started happening again in mid-January. Now it happens to me every time I launch the iPhone simulator.

The only way I've been able to work around this is to delete all my simulators from the organizer in Xcode and re-add them one by one, but I'm now at the point where I have delete and re-add the simulator any time I want to cold boot it. I cleaned my simulators out this morning and cold-booting my one iPhone 12 Pro simulator locked up my computer again this afternoon.

I'll try to gather a sysdiagnose report but given how badly locked up everything is (mouse movement seems okay but that's all that's responsive), I have my doubts I'd be able to get one.

  • this, happening regularly after an update to Xcode 13.3.1, running on iMac Pro. If I'm lucky and have enough spare time, I can kill the sim with a force quit, but it takes ages for a gap in the sim time-slicing to get control to do it. After killing the sim process, a smal dialog appears that says something like "invalid device state"

Add a Comment