while exploring the swiftUI and creating my first swiftUI app in Xcode, it is throwing an error for the preview saying - Cannot preview in this file, Cannot connect to [Device Name]. While it's working fine in simulator.
In order to troubleshoot, I've already tried all the basic hacks like -
- Deleting the DerivedData,
- Uncheck Automatically Refresh Canvas [As suggested in some stackOverflow answers],
- Rebooting the mac[Intel Based]/device,
- Updating the latest macOS [currently it's 12.5.1],
- Removing the Xcode completely,
- Installing the latest Xcode from scratch [Currently it's Xcode v14.0],
- Tried removing all the simulators and installing a fresh one.
On the stackOverflow, there are few similar questions asked, but the reason is different after the title "Cannot preview in this file ..... "
attaching the screenshot of newly created test project >>
Please suggest with any solution which can help to resolve the issue, Thanks in advance