简体   繁体   中英

ios simulator shows black screen

Xcode 5 ios simulator stopped working for one of the applications I was developing it works on any other project, there is no build error or anything the simulator opens but there's only a black screen showing.

You can reset the simulator using the Reset Content and Settings...

在此处输入图片说明

Sometimes the simulator get hung for no obvious reasons. Xcode shows in the status display that the app is running.

If this happens i click the home button of the simulator and then immediately click the app icon again. Then the app appears again and everything is visible wihtout stopping the app or the debugger.

In some cases where hitting Reset Content and Settings... does not work, it may be due to the background the of the screen being set to Default . This was the issue in my case.

If this is the case (for anyone who may be having the same problem I did), just click on empty area of the storyboard screen being displayed and switch the background from Default to something else, like White for example:

Change Background from this:

在此处输入图片说明

To this:

在此处输入图片说明

I initially made a not needed Referencing outlet of button in a internal View [inside main View] to main View. Whenever i used to make changes on storyboard, "main View" [not entire screen] displayed black screen. After removing button reference, it worked properly.

I'm in learning stage, made a attempt to help.

Solution 1 : Quit simulator then clean Xcode (both clean and clean build folder) and then run again.

Solution 2 (Recommended) : Go to iOS Simulator -> Reset Content and Settings...

第 1 步

This will pop-up an alert stating 'Are you sure you want to reset the iOS Simulator content and settings?'

第 2 步

Select Reset button. Note that once you reset simulator content all app installed on simulator will be deleted and it will reset to initial settings.

Try to reset as described above: (see: Reset Content and Settings... )

If it still didn't help try to scale from the simulator menu;

select Windows--->scale--> %25 or %33 etc.

I tried what all others recommended in several blogs.What worked in my case is I had to uncheck "hidden" check box in attribute inspector. Once I did that I started seeing the UI when my app builds and runs. I was working to show cells in collection views. enter image description here

查看图片

For me, the simulator that was crashing was iPhone 13 with iOS 15.2. None of the other solutions worked.

After that, I started the previous device (iPhone 13) again, and it worked too.

on my case i have macbook pro 2015, macos monterey, xcode 14.0 open debug -> graphics quality override and chose low quality在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM