Today, I wanted to continue one of my current app projects, when I was suddenly hampered by a strange behavior of my iOS simulator. Usually I’m used to clicking „Start Debugging“, and everything works like a charm. But today all that I got was a blank iOS simulator Window:
As I said above, I’m usually used to it working like a charm, so it was surely strange.
At first, I was thinking about any changes that I might have made to any of the two systems, since the last time it worked (which was just about 12 hours before). I came to the conclusion, that neither on my Windows PC, nor on my Mac there were any recent changes (no Updates, no system changes, nothing).
Next, I did the obvious: Restarted the Mac, restarted my PC, checked for Updates, all the usual things. But still: The iOS simulator was broken.
At this moment I need to admit, that my knowledge about native iOS development under macOS it pretty much zero, so I didn’t have much of a clue about what to do on the macOS side.
Investigating the problem
Even without knowing things under macOS too well, I came up with a very basic, fundamental question: “Does the simulator run, if I directly run it on the Mac?”
This led me to another, also very fundamental question:
“Where can I run the simulators under macOS?”
Luckily that wasn’t too hard to find out. I just fired up Xcode and found the solution quickly:
- I opened Xcode
- In the top menu, I selected “Xcode -> Open Developer Tool -> Simulator”
- Shortly after that, I was presented with an iPhone shaped iOS simulator. But surprise: It was also blank!
- I switched to a different simulator (e.g. File -> Open Device -> iOS 13.5 -> iPhone 8). The iPhone 8 is one of my usual simulators used in Visual Studio, so I wanted to try that out. But still: Just a blank window… =/
- I starred at the two dark simulators, while thinking about what to do next. But then, suddenly, after 2-3 minutes: The apple icon appeared inside the emulator windows. A few seconds later, I was presented with the colorful iOS UI.
- And it got even better: The simulator windows in my Visual Studio also immediately came back to live. My problem was miraculously fixed. Phew….
I was happy that the problem could be fixed so easily, although I was wondering how it came into being in the first place. It was also strange that before, not even a reboot of both, the Mac and my PC, could fix it. The problem never recurred since then.
The solution was quite easy in the end: Switch to the Mac, open up Xcode, run a Simulator from there and wait 2-3 minutes.
This experience was a little strange, and quite esoteric to solve. I hope by documenting this I can help someone who may stumble over the same problem in the future.