I'm seeing the following error message when attempting to test a Spotlight importer that sits in a sandboxed, developer ID codesigned app bundle.
➜ Manuscripts git:(feature/mz2-beta) mdimport -g /Applications/Manuscripts.app/Contents/Library/Spotlight/Manuscripts\ Spotlight.mdimporter ~/Desktop/Steve\ Ballmer.manuscript
2015-08-17 02:27:28.856 mdimport[8895:42509316] Failed to obtain sandbox extension for path=/Users/mz2/Library/Caches/mdimport. Errno:1
2015-08-17 02:27:28.861 mdimport[8895:42509316] Failed to obtain sandbox extension for path=/Users/mz2/Library/Caches/mdimport. Errno:1
2015-08-17 02:27:28.924 mdimport[8895:42509316] IORegisterForSystemPower failed
2015-08-17 02:27:28.925 mdimport[8895:42509316] IORegisterForSystemPower failed
The same plugin works fine when not sandboxed.
I've tried various options related to codesigning: no entitlements (this seemed to work OK for a QuickLook plugin that's inside the same app bundle), or "com.apple.security.app-sandbox" or the same entitlements file as used by the main app. The documentation on the topic does not seem to be all that current or conclusive.
Googling around "IORegisterForSystemPower failed" seems to suggest this is something to do with system wake / sleep. Not quite sure what to make of that either?