Simulator is a black screen

I am new to iOS development. I was working on a Xcode project, without any warning nor change in my system, the editor started to behave extremely slow. To the point it looked like it crashed, but still responding after several seconds.

Following some "solutions" found in the internet, I deleted some project-related settings, without success. Then also tried and deleted ~/Library/Saved Application State/com.apple.dt.Xcode.savedState and ~/Library/Developer. After this the editor actually opens but... if I try to open my Main.storyboard I see this: enter image description here

And I cannot do changes to the interface. I think I could isolate this being related to the simulator, as it is unable to run my application(s), however I can run them fine in my iPhone.

At this point Xcode is barely usable. I have already tried and reinstalled the whole application, no changes. I strongly believe it has to do with the simulator but I don't really know if this is some standalone component I can remove/install.

The version of Xcode is 12.4 (12D4e) and my OS is Catalina 10.15.7 (19H114). I am running these programs in a MacBook Pro 16" 2019.


Solution 1:

So I made it work in the end, yet I am not very clear with the root cause of the problem. Any further information is more than welcome.

I found that the problem (Blank screen) only happened when I wanted to emulate an iPhone 11, so I thought it was related to that one simulator. Using the simctl I deleted all the unavailable emulators:

xcrun simctl delete unavailable

Then in Xcode, in a new project lean enough to respond "in time", I went to the device manager and deleted my iPhone 11 emulator, then created a new one of the same model with the same iOS version.

After that, the Main.storyboard began to display properly for any model I could choose and the emulators were able to boot any of my applications.

I don't know why this happen, I don't know how to reproduce this, but I know that now it works. I hope this helps someone in the future.