PreviewShell crashes and breaks the preview canvas

Since the first beta of Xcode 16, randomly when editing a SwiftUI view a crash report opens with the message "PreviewShell quit unexpectedly." After that, annoyingly often the canvas fails to reload correctly, and shows this broken thing:

The only way to get it working again is to restart Xcode, but it happens so often that it really impacts productivity.

Does this happen to anyone else? If so, have you found a solution?

I've already filed a report (FB14876223)

Answered by Developer Tools Engineer in 802012022

Hi,

Sorry to hear you are having problems getting previews working consistently. You are unfortunately hitting a known issue without a great workaround.

I see you've identified that quitting xcode works. A slightly faster workaround that you can try is to run this in Terminal.app xcrun simctl --set previews shutdown all and then reload the preview.

I also face this (but haven't seen the half working state yet, it hasn't worked once for me)

btw your radar link says not found

Accepted Answer

Hi,

Sorry to hear you are having problems getting previews working consistently. You are unfortunately hitting a known issue without a great workaround.

I see you've identified that quitting xcode works. A slightly faster workaround that you can try is to run this in Terminal.app xcrun simctl --set previews shutdown all and then reload the preview.

this 'known issue' is still interrupting my workflow every few minutes. - Is there going to be a 'known FIX' for this? or is Apple satisfied with a Terminal command workaround?

Same here!

Hello,

I’m increasingly frustrated with the recent issues in iOS 18 and Xcode 16. The navigation problems in iOS 18 are a mess, and the constant crashing of SwiftUI previews in Xcode 16 is crippling my workflow. The suggested fixes haven’t helped, and this is seriously affecting my productivity.

Please address these issues urgently, as they’re making it difficult to get any work done with Xcode.

same here! Can anyone help me to fix it?

Enabling Editor -> Canvas -> Use Legacy Previews Execution seems to have resolved the issue for me.

PreviewShell crashes and breaks the preview canvas
 
 
Q