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.
Asked
Active
Viewed 720 times
2
-
Can you show how you are setting up your Xcode project? – jvarela Mar 08 '20 at 13:47
-
Hi, I just put the code on Github https://github.com/mgfjxxiexiaolong/FirUpload, It's just an empty project. – mgfjx Mar 09 '20 at 09:00
-
Go here: https://developer.apple.com/library/archive/documentation/General/Conceptual/ExtensibilityPG/Finder.html – jvarela Mar 09 '20 at 21:13
-
And here: https://blog.codecentric.de/en/2018/09/finder-sync-extension/ – jvarela Mar 09 '20 at 21:15
-
The main thing is to have a main app in order to debug the extension. – jvarela Mar 09 '20 at 21:15
-
You need to attach the debugger to the Finder Sync Extension process: https://stackoverflow.com/questions/9721830/how-to-attach-debugger-to-ios-app-after-launch – pkamb Mar 09 '20 at 21:52
2 Answers
4
This works for me...
- Create a new application project
- Add a new target - File -> New Target and add the finder sync target.
- When you are ready to debug, select the extension target - Product -> Scheme -> --Your FINDER_SYNC_EXT Name --
- Choose the Xcode Debugger for attaching finder sync extension - Debug -> Attach to Process by PID or Name
- Chose your extension and click Attach
- Xcode status panel will be updated to "Waiting to attach to -- Your FINDER_SYNC_EXT Name --"
- Set your breakpoints and run your extension.
Your breakpoints will be triggered.

Spanners
- 366
- 2
- 20
1
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.
- Run Finder sync extension.
- Xcode will prompt to select the target process.
- Select the Finder process.
- Relaunch finder.

Parag Bafna
- 22,812
- 8
- 71
- 144