Xcode Canvas preview connected to iPhone error

"Can not preview in this file"

Xcode 16.0 iPhone 14 Pro , iOS 18.0

When I choose to start Preview on my iPhone, the canvas screen keeps showing loading circle animation. The iPhone enters the Xcode Previews App but only displays the default screen (Xcode icon& 'Preview from Xcode')

I uploaded the some of diagnostics files

Hi,

Sorry to hear you are having problems getting previews working. Some of the output you included has this error listed com.apple.dt.deviceprep. It'd be interesting to know if you are just seeing issues with previews on-device, or if building+running the app (⌘R) on the device has problems too?

Though looking at the logs you included they make it look like you are attempting to do an in-canvas preview, at which point my previous question doesn't apply.

I think probably the best way to dig in to this further would be for you 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.

If you are having issues with Xcode, 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 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 the sysdiagnose(s) and attach those too
Xcode Canvas preview connected to iPhone error
 
 
Q