Hi guys, when I trzy to build an app using SwiftUI the preview preparation lasts for a very long time and finally I see a message about timeout: Timed out waiting for connection to DTService after 15.0 seconds. In addition it appears a window with the second one that the app MobileCal quit working unexpectedly. So I don’t know what to do. I would like to learn and use SwiftUI. In Building apps for Mac has been working properly but for iOS it is the Mission Impossible….
Swift preview SwiftUI mode for iOS app not working at all…
Hi,
Sorry to hear you are having problems getting previews working.
Best next step will be to file a feedback with diagnostics. We will need the diagnostics Xcode Previews generates in order to make sure we understand the error the previews system is encountering.
If you are having issues with macOS, catalyst or on-device iOS previews then download and install the logging profile for your device. Instructions and profiles are available here: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=swift Attach the sysdiagnose to the radar as well as the diagnostics using the instructions below.
Then when you get an error in Xcode Previews, an error banner appears in the canvas
- Click the "Diagnostics" button in that banner
- 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
)
To be honest, I stopped using the previews as it's so slow in mac mini m1. When I add a new file, I delete the code which is responsible for the preview and always run the simulator to see if I did it correctly. It's a pain in the bum, but still better than non-responsive previews.