I’m working on developing a few plugins for some Mac OS X applications. I was having a hard time debugging the plugins, since I had use an NSLog() statement to write out to a file every time I launched the application and used the plugin.
I thought there had to be a better way. Turns out there is.
Xcode 4.6 (not sure about earlier versions) can launch the application for you, and then you can set breakpoints and all the regular debugging tools when the plugin is activated.
The trick is in the Schemes. Under Product, you can look at the various project schemes you have available to you. Under Run, open the Info tab, and you can select the executable to launch when you run the project. After doing this, run your project, and the executable will be launched.