How to debug FinderSync extension in Xcode

800 views Asked by At

I created a FinderSync extension, when I run the extension target, the console and the breakpoints did nothing, so how to debug the extension in xcode? I'm a new devleoper for MacOS.

2

There are 2 answers

0
Spanners On BEST ANSWER

This works for me...

  1. Create a new application project
  2. Add a new target - File -> New Target and add the finder sync target.
  3. When you are ready to debug, select the extension target - Product -> Scheme -> --Your FINDER_SYNC_EXT Name --
  4. Choose the Xcode Debugger for attaching finder sync extension - Debug -> Attach to Process by PID or Name
  5. Chose your extension and click Attach
  6. Xcode status panel will be updated to "Waiting to attach to -- Your FINDER_SYNC_EXT Name --"
  7. Set your breakpoints and run your extension.

Your breakpoints will be triggered.

0
Parag Bafna On

You are getting this issue because macOS will launch an instance of your finder extension when you launch the container app. You need to relaunch finder after running the finder extension.

  1. Run Finder sync extension.
  2. Xcode will prompt to select the target process.
  3. Select the Finder process.
  4. Relaunch finder.