XCode don't load preview at lunch of new document


I have had trouble previewing things for a few days to the point I had to stop the courses ISO Foundation cause I couldn’t see if what I was typing was the same as in the video. I went online and saw a post from 2021 but nothing new. But I try everything they said (cleaning the build folder, changing the view type from iPhone 14 pro to iPhone 14 etc.) I even erased Xcode from my Mac and redownloaded it.

To make sure it wasn’t my document the problem, I just opened a new one and with the starting code only (Hello world etc) It has been working to build the preview for now 10 minutes and this showed up

Help :frowning:

Welcome to the community! Have you deleted the derived data folder?

That’s a good question! Where could I see if I did ?

Sounds like you haven’t done it yet! Deleting Derived Data is useful for because it clears build files more so than just “cleaning” the project with Cmd + Shift + K

  • Go to Xcode preferences (Cmd + , shortcut)
  • Go to Locations tab
  • derived data should show a drop down that says “default” right under that is a file path.
  • open that file path by clicking the arrow
  • Close Xcode (not required but I usually close it)
  • Delete the Derived Data folder

Good idea!
I tried it and it didn’t work. It has been stick in prep iPhone 14 (and 14 pro I tried both) for Simulator.
Its not the DTServer connexion the problem anymore. Its just that the preview doesn’t load.

Update: I tried the Iphone Simulator and it worked so its only the preview in Xcode that doesn’t work

That’s interesting.

Install this tool called Dev Cleaner for Xcode (download it from the Mac App Store, and delete all the files

(This deleted derived data and other build files as well).

And then I’d fully uninstall Xcode (again).

And instead of installing Xcode from the Mac App Store, use Xcodes (with an s at the end) to install the latest version of Xcode

Because the preview should work, and it not working on a brand new project means something may have happened with the installation.