SwiftUI Previews not working Xcode 15 iOS 17 simulator

SwiftUI preview hangs on "Preparing iPhone Simulator for Previews". Also simulator hangs when trying to build and run. This occurred after I installed iOS 17 simulator. I tried reverting back to an iOS 16 version of the simulator, but haven't figured out how to do that. Build and run to an iPhone device works fine. Any ideas would be appreciated. Thanks.

Post not yet marked as solved Up vote post of dekyte Down vote post of dekyte
2.3k views

Replies

Hi,

Sorry to hear you are having problems getting previews and the simulator working. Best next step will be to file a feedback with diagnostics so we can take a look.

Steps to generate helpful diagnostics:

  1. Download and install the logging profile on all devices involved. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift
  2. Reproduce the issue
  3. Click the "Diagnostics" button in the error banner in Previews' Canvas area (or if the banner is missing you can use the menu: Editor > Canvas > Diagnostics)
  4. In the sheet that appears, click "Generate Report" in the bottom left of the sheet
  5. Attach (or make from the folder) the resulting zip file to the bug (will be named something like previews-diagnostics-0123456789.zip)
  6. Generate the sysdiagnose(s) and attach those too
  • Exactly same behaviour feedback left FB13201435

Add a Comment

I have the reports in zip format, but can't attach them. Files are gray'd out. Am I doing something wrong?

  • Have you tried dragging and dropping the files over into the upload window?

Add a Comment

Where is the upload window? Sorry, but I'm new to Developer Forums. I tried clicking "Reply", then the "paper clip", then "Add Files", but when I try to select the files, they are gray'd out.

  • Ah ok so to leave feedback on an issue you will have an application on your Mac called "Feedback Assistant". Press CMD + Spacebar. Then simply search for Feedback assistant to launch it. Its with that app you.... well, send feedback.

  • Great. Thanks for the advice RyanTCB.

Add a Comment

So I just added more RAM. Was on 8gb and added another 32gb to make it 40gb. The simulator now at least loads but still a slow process but under 5 mins to launch as apposed to the +30 mins to infinity I was having to wait. Preview still doesn't work so not a fix adding more memory just a step in the right direction it seems.

Submitted feedback FB13209826.

Will there be any update on this issue? Does anyone actually review the feedback?

Has anyone found a solution to this issue? I'm dying to know as this has stopped some dev for me. Thanks in advance!

Hi team, issues is on the preview just revert back to the hold preview type

Struct Nameofyourswift_Previews: PreviewProvider {
static var previews: some View {
//yourcode
}
}