I am developing "Thumbnail Extension" and "Quick Look Preview Extension" on Mac Apple M2 with Sonoma 14.5
These extension need 3rd party dynamic lib. (This .dylib I develop in Delphi FMX on Windows computer for macOS.ARM 64-bit architecture)
I was able to drag & drop this .dylib to "Thumbnail Extension" target in XCode, "Embed & Sign" on "General" tab and then use dllopen/dlsym/dclose to use it in .swift code - and it works as expected, generating thumbnails for my custom extension files.
However the same steps do not work for "Quick Look Preview Extension" target:
- The .dylib is drag & drop added to this target of my XCode project, "Embed & Sign" on "General" tab and build & run.
- I obtain "Previewer not found." dialog when SPACE-key viewing a file in Finder. (This happens even without calling dllopen/dlsym/dclose in my code.)
- After removing the .dylib from target "Quick Look Preview Extension" it works and shows my simple "generic hello world" graphic as Preview.
I have checked the container of app bundle on disk to make sure that .dylib is on correct place, and it is:
my.app/Contents/Plugins/Previewer.appex/Contents/Frameworks/libmydll.dylib
The size of this .dylib is 13.5 MB The .appex and .dylib are both signed, using "Development" signing certficate.
I am confused why this .dylib is working for "Thumbnail Extension" but not for "Quick Look Preview Extension". It seems to me that due to some reason system rejects to load this extension as soon as it contains .dylib, even without accessing it from my code.