0

I'm using the FinderSync extension template.

Info.plist

When I run the extension target there's zero output in the console. The code doesn't seem to run.

running the extension

AdrienM
  • 174
  • 2
  • 3
  • 10
  • Could you please change your question to directly include what you really want to do: running your Finder extension inside XCode ? – Liviu Nov 22 '18 at 09:49

2 Answers2

3

I've found success in running the main app target from Xcode rather than the Finder Sync target.

If things are set up correctly, running the main app will in turn install the Finder Sync extension.

Make sure that you have enabled the Extension:

System Preferences > Extensions > Checkbox for Your Extension

This does make debugging a bit annoying, as the debugger will not be attached to the Extension. Simple debugging can be accomplished by setting text to the Finder menus, os_log() to the system console, etc.

You may also be able to attach to to the Extension via Debug > Attach to Process.

pkamb
  • 33,281
  • 23
  • 160
  • 191
2

So the question is really about how to run a Finder extension inside XCode (how to debug it).

Firstly, you need to register your extension in Finder:

pluginkit -a <path you your debugging appex>

Then, you have to wait to attach to the running instance in Xcode: Debug menu, Attach to Process by PID or Name ... and then enter the name of your executable. Now Xcode is waiting for it to start.

Finally, tell Finder to enable your extension (or restart Finder):

pluginkit -e use -I <ID of you appex>
Liviu
  • 1,859
  • 2
  • 22
  • 48