Unable to preview on latest Xcode

I'm new to Xcode and decided to give it a try, however, I'm unable to preview even the default "hello, world" message.

I've tried downloading Xcode on the App Store on Mac and from the official website, but I couldn't go pass the "Preparing (Automatic) iPhone Simulator."

I've also tried the following line of code on Terminal, but nada:

xcrun simctl erase all

Here's what I see for almost two hours now (it makes no sense):

My system specs: iMac Retina 4K, 21.5-inch, 2019, 3 GHz Intel Core i5 6-Core, Radeon Pro 560X 4 GB, 8 GB 2667 MHz DDR4 (two 4gb core each), 1TB SSD.

I've coded way bigger web projects using various applications, but Xcode can't even preview the sample file?

Please, help. I would really like to code using Swift. :)

Sure it works. I've tested with Xcode 16.2, MacOS 14.7.2 and using iPhone 16 Pro simulator as in your case.

How long ago did you install Xcode ?

Are you sure installation is complete ? Or were you asked to download simulators.

If so, did you do it ?

Try to

  • select another simulator, or
  • restart Xcode.
  • If that does not work, try to reinstall, from a different site. This one works well: https://xcodereleases.com

Hi @Claude31, thanks for the response.

Just updated to Sequoia (15.2 (24C101)) but the issue persists.

I completely reseted my iMac to its default settings, downloaded it from the official website again, simulators were downloaded without a problem, however, when it comes to previewing, nothing happens.

It just keeps spinning, as shown in the OP.

I even enabled Legacy Previews, but it didn't seem to work.

Hi,

Sorry to hear you are having problems getting previews working. To verify that the simulators work outside of previews on your system could you attempt a build+run of your app ⌘+R ? If that works then the best next step will be to file a feedback with diagnostics so we can take a look.

We will need the diagnostics Xcode Previews generates in order to make sure we understand the error the previews system is encountering.

Install the logging profile using instructions available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift On your mac running Xcode, and on your physical preview device (if you are using one).

Install the logging profile using the following instructions on your mac running Xcode; and if you are using one, your physical preview device (iOS or visionOS): https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift

Then when you reproduce the problem in Xcode:

  1. Either (a) an error banner will appear, click the "Diagnostics" button in that banner; or (b) if you're not seeing an error but you still want to provide diagnostics you can get the same diagnostics window by going under the Editor menu in the menu bar, then selecting the Canvas submenu, then selecting "Diagnostics".
  2. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  3. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)
  4. Generate a sysdiagnose on your mac and any on-device preview devices, and attach those too

@Developer Tools Engineer

As for your question:

To verify that the simulators work outside of previews on your system could you attempt a build+run of your app ⌘+R ? If that works [...]

Well, I think it didn't work? This popped up after I pressed ⌘+R, subsequently after it showed 'build succeeded':

I'm new to Xcode (this is literally the first time I'm (trying) to code using SwiftUI).

I checked on Xcode > Settings > Components to see if there's something wrong, but apparently everything's fine.

Is there something else I could do?

Unable to preview on latest Xcode
 
 
Q