When I launch the Quick Look Preview Extension target in Xcode, an app called Quick Look Simulator opens with an almost empty window:

Online I read that the Terminal command qlmanage allows to test Quick Look plugins (which I think were an older format for creating Quick Look extensions), but running
qlmanage -p /path/to/previewed/file -c public.text -g /path/to/QuickLookPreviewExtension.appex
(where QuickLookPreviewExtension.appex is generated by the Xcode build and is located in the DerivedData folder) gives an error
Can't get generator at QuickLookPreviewExtension.appex
How can I debug a Quick Look Preview Extension?
This is (somewhat) explained in this video at 20:45 mark: https://developer.apple.com/videos/play/wwdc2019/719
And Apple's slightly imperfect transcript:
To debug, launch your extension target with Xcode. Note that Xcode will launch the Quick Look simulator by default. This is to aid in debugging Core Spotlight previews which are extension can also provide support for. To debug regular file previews, you can ignore the simulator and invoke your preview with finder or QLManage. As long as your preview extension is launched through Xcode, Xcode will automatically attach to it.
So the steps are:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With