Recently, some of my simulators launched and loaded just fine. Others simply went black. It didn’t seem to matter which firmware I was simulating. Some devices were just happier than others.
Naturally, I turned to the system console, which provides device-by-device logs, but I couldn’t really find anything.
I tried restarting and rebooting the sims. I tried resetting the core simulator service. I tried a lot of things. (No actual chickens were harmed.) Finally, I stumbled across a Apple Dev Forum thread about issues with the beta system. The advice offered in-thread was this:
- Quit the simulator. (I also killed
xcrun simctl erase all
- Set a framebuffer renderer hint:
defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint 3
From the thread, apparently hints 1 and 2 do not work but 3 does. An Apple Engineer noted that, “hint 0 is auto (currently prefering Metal and then falling back to OpenGL if unavailable). Hint 1 prefers Metal and hint 3 prefers OpenGL. Hint 2 used to mean OpenCL, but we dropped OpenCL support.”
Upshot is that I lost many hours but I seem to have a working solution for dealing with a common problem. I hope this write-up helps you if you encounter the same issues.
Update: Guru Russ Bishop recommends against using this long term. He writes
And to clarify, Metal vs OpenGL is purely for the framebuffer blitter. Actual rendering in the sim is still the OpenGL ES software renderer
— Russ Bishop (@xenadu02) June 20, 2018
If you (as I) have deadlines, and cannot wait for this problem to be fixed, this fix will get you back to work. Russ reminds me, though, “Use it temporarily only if you have this problem, and don’t forget to delete the pref in the future”