Home > database >  Xcode 13.2.1 Preview Not Working but Simulator Works
Xcode 13.2.1 Preview Not Working but Simulator Works

Time:01-08

My Xcode Version 13.2.1 (13C100) got an unknown issue. I did several things like delete Xcode, new install Xcode, restore from backup nothing make any change! Currently, the project can be built and run in the simulator, but not in the preview window! it gives a message:

Cannot preview in this file - Timed out waiting for connection to DTServiceHub after 15.0 seconds.

What is the issue here any idea? iMac becomes very slow when I taped the resume button. Please Help!

enter image description here

CodePudding user response:

I had a similar problem and was solved when I turned of Automatically refresh canvas

enter image description here

CodePudding user response:

Try the following:

  1. Clicking on the "Diagnostics" button on the failed preview pane.

  2. Copy the ".pcm" file path. It looks like something similar to "/var/folders/aa/xxxxxxxxxxxxxxxxxxxxxxx/C/clang/ModuleCache/12345ABCDE/MyTest-XXXXXXXXXXXXXX.pcm"

  3. Run the following command to remove the .pcm file in the Terminal app (replace the path using the specific path you copied from the Diagnostics log obtained in the step above:

    rm -rf /var/folders/aa/xxxxxxxxxxxxxxxxxxxxxxx/C/clang/ModuleCache/12345ABCDE/MyTest-XXXXXXXXXXXXXX.pcm

References:

  1. https://support.macincloud.com/support/solutions/articles/8000098646
  2. https://developer.apple.com/forums/thread/696908
  •  Tags:  
  • Related