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!
7
Answers
Suddenly It fixed, maybe the last update from apple through a software update called "Command Line Tools for Xcode". Before I have also tried a fresh OSX installation but the issue has not gone at all.
Thanks to the great community.
I had a similar problem and was solved when I turned of Automatically refresh canvas
Try the following:
Clicking on the "Diagnostics" button on the failed preview pane.
Copy the ".pcm" file path. It looks like something similar to "/var/folders/aa/xxxxxxxxxxxxxxxxxxxxxxx/C/clang/ModuleCache/12345ABCDE/MyTest-XXXXXXXXXXXXXX.pcm"
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:
on a Mac with apple silicon chip
I had the same problem:
No preview with diagnostic : "Cannot preview in this file – Timed out waiting for connection to DTServiceHub after 15.0 seconds".
Tried the solutions found on the internet, without success.
I switched to macOS beta 12.3 and Xcode 13.2.
And now there is the preview…
The below solution has worked for me:
Running a preview for a project having scenedelegate or appdelegate which worked and then i tried running preview for app protocol style project which was not working earlier.
For me, it worked when I changed the device to Any iOS Device(Arm 64) for the preview