14

I know that so many people have asked this question earlier. But I think my situation is different. In my case Xcode 9.2 was already installed and I upgraded macOS from 10.13.2 to 10.13.5. Then I installed Xcode 10 beta. Now when I'm running any project on Xcode 9.2 and try to use simulator, its becoming black though I can see the xcode logs. Things I have tried so far,

  1. Uninstalled Xcode 10 Beta
  2. Uninstalling & reinstalling Xcode 9.2
  3. Uninstall Xcode 9.2 and install Xcode 9.4
  4. Reset Content & Settings from simulator menu
  5. Restart Device from simulator menu
  6. Resizing simulator.
  7. Followed this post and cleaned DerivedData, CoreSimulator, iOSDeviceSupport
  8. Re add simulators from devices & simulators section

Now what should I do now?

Cœur
  • 32,421
  • 21
  • 173
  • 232
Poles
  • 3,307
  • 6
  • 38
  • 82

7 Answers7

22

Try running defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint 3 in Terminal (source). Note that this will force Simulator to use OpenGL instead of Metal, so you'll want to re-run it with 0 once this gets fixed.

Ted
  • 3,110
  • 2
  • 15
  • 11
  • 2
    This code help to fix black screen but re-run the same code with defaults write `com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint 0` will make the simulator black again. So I will stick with `3` until apple releases a fix. – Poles Jun 20 '18 at 09:26
  • This works. I noticed one thing: the moment you start Grab to take a screenshot with the device bezels for promotion, OSX resets this default, and nothing short of a reboot will fix it. Potentially, you could have other programs installed that might cause this behavior as well, when you start them. – Henrik Erlandsson Dec 12 '18 at 09:34
1

try workaround, delete Library/Developer folder and start it again

0

Another option that occurred for me. I subclassed UIWindow and called .init(frame: .zero). Changing to .init(frame: UIScreen.main.bounds) fixed it.

Daniel
  • 337
  • 3
  • 8
-1

Open up XCode 9 and go to add additional simulators(pictured below) re-add iOS 10 and iOS 11 simulators

enter image description here

Alex Chase
  • 721
  • 6
  • 11
-1

You seem to have tried everything except changing the iOS simulator version you are trying to run.

Maybe the problem lies with that specific version of iOS simulator eg. iOS 11.x iPhone 6. Change that and it may run OK.

  • If you do not have desired version with you, go to XCode->Preferences->Components, and download one of the older iOS simulators available at the time of XCode 9.x.
  • Then, go to XCode->Windows->Devices and Simulators. Press + sign at the bottom left of the screen. Add your desired simulator version (give your desired name), so that this newer simulator appears in runnable scheme list of XCode.
Nirav Bhatt
  • 6,682
  • 5
  • 39
  • 82
-2

This is just for the users that failed trying everything to save Xcode 10 and then reinstalled Xcode 9.4.1 and the simulator still not working.

Here is what I did to give Xcode 9.4.1 back running. After I got this problem after upgraded to Xcode 10. I tried that famous FramebufferRendererHint, didn't work for me. I have found out the Xcode 10.1 beta release didn't fix the problem for someone else, so I didn't bother to try 10.1 beta.

From the online research I know the problem is in /Library/Developer/PrivateFrameworks/CoreSimulator.framework. Without Xcode even installed on your Mac /Library/Developer doesn't exist. So it is installed by Xcode when your first time run Xcode. You would notice a screen showing "Installing Components" But after you installed Xcode 10 and then install/run Xcode 9.4.1 it won't touch that folder anymore. So problem stays even you put Xcode 9.4.1 back

That's why after I downloaded Xcode 9.4.1 expanded and ran it. Problem still there.

I didn't backup my Mac. So I decided to start from scratch. Restored my MacBook from Internet, downloaded Xcode 9.4.1 again. and now everything is back to normal. I can keep releasing the App to App Store now.

Paul
  • 1,070
  • 11
  • 18
  • So are you using Xcode 10 final version or beta version right now? – Poles Sep 24 '18 at 10:31
  • I am using Xcode 9.4.1 right now. I tried to use /Library/Developer/PrivateFrameworks/CoreSimulator.framework from Xcode 9.4.1 in Xcode 10. But it didn't work. A lot errors when compiling. – Paul Sep 24 '18 at 19:23
  • 1
    I had to switch to Xcode 10 to keep my development going. Just use iPhone 8 for testing. If Apple doesn't fix it in a couple of weeks, I will be forced into buying a new MacBook Pro because I have to release the new App by then. – Paul Sep 25 '18 at 21:07
-2

In my case (xcode 10), I just left the computer for 10 minutes or so (out of frustration!) and when I came back I found it at the starting screen! .... I guess for the first time it takes time

salouri
  • 697
  • 6
  • 17