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.
SwiftUI Previews not working Xcode 15 iOS 17 simulator
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:
- 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
- Reproduce the issue
- 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)
- In the sheet that appears, click "Generate Report" in the bottom left of the sheet
- Attach (or make from the folder) the resulting zip file to the bug (will be named something like
previews-diagnostics-0123456789.zip
) - Generate the sysdiagnose(s) and attach those too
I have the reports in zip format, but can't attach them. Files are gray'd out. Am I doing something wrong?
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.
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
}
}