1

I can't get my QuickLook Plugin to run when built on OSX Mavericks with Xcode 5.1. The meat of the plugin is quite simple (<20 lines of code). It simply makes a system call, and sends the resulting string to QLPreviewRequestSetDataRepresentation(..).

I originally made the project on Snow Leopard or Mt Lion, using Xcode 4.6. I was able to compile and run the project no problem. When I migrated to Mavericks, I was able to copy my old .qlgenerator file to ~/Library/QuickLook and the plugin worked fine. However now I need to re-compile the project with Xcode 5.1. The project uses the default settings provided by Xcode when starting a new QuickLook Plugin project, and like I mentioned, it builds successfully. As far as I can tell, the compiled binary appears fine.

I set up to debug the program as advised in this question: Debugging Quicklook Plugin in Xcode 4.6. But when running the plugin, I get this output:

Testing Quick Look preview with files:
~/my-test-file.nc
2014-09-09 16:52:43.071 qlmanage[46315:303] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x8c27, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2014-09-09 16:52:43.074 qlmanage[46315:303] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x8f4b, name = 'com.apple.CFPasteboardClient'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2014-09-09 16:52:43.074 qlmanage[46315:303] Failed to allocate communication port for com.apple.CFPasteboardClient; this is likely due to sandbox restrictions

In addition, if I copy the .qlgenerator file (compiled with Xcode 5.1) to ~/Library/QuickLook, I can't get qlmanage to pickup the new generator.

I have also found this question: QuickLook Plugin Failing with sandboxing error, which seem like it could be related. I read up a bit on how Apple's Sandboxing is supposed to work, but I can't figure out how to add entitlements to a QuickLook Plugin. I can't find the "Capabilities" panel mentioned in Apple's docs for adding entitlements.

EDIT: This also appears to be related: sandbox custom qlgenerator (Quick look) plugin.

Community
  • 1
  • 1
tbc
  • 1,679
  • 3
  • 21
  • 28

1 Answers1

1

Answering myself. By use of some additional command line options to qlamange and a couple NSLog statements, I discovered that the plugin when compiled with Xcode 5.1 was actually working fine, but I had a problem with the UTI string in the project's Info.plist file. This prevented the qlmanage from being able to pick up the plugin.

As it turns out, with the UTI strings fixed, when the plugin is run thru Xcode, I still get the sandboxing errors in Xcode's debugging panel, but the plugin works fine. When the plugin is installed in ~/Library/Quicklook and properly registered with quicklookd, there are no errors that show up in the system log, so all appears to be OK.

tbc
  • 1,679
  • 3
  • 21
  • 28
  • For other folks reading this, you might find these Xcode 6 instructions useful: http://stackoverflow.com/a/27612166/893113 – paulmelnikow Jan 31 '15 at 20:57