Configure Xcode for plugin development

I have never worked in Xcode before, but I am developing a plugin (objective-c) for an open source radiology program called OsiriX. I can get the compilation, and I can even run the plugin in OsiriX. But I'm not sure how to run / debug it with Xcode. Run / Debug is grayed out on my xcode. Is it because there is no main program?

+4
source share
3 answers

(1) β€œClean all” your projects so that there is no detritus during the execution.

(2) Install Xcode to use the general assembly products directory (I bind my / tmp / so that it periodically resets). Preference is given to the "Construction" section.

(3) Rebuild OsiriX (so that it is built into the shared folder).

(4) Make sure that the active configuration of your plug-in project has the same name as the configuration in OsiriX that you created (3). (This should probably be "Debug" or "Release", depending on what you are creating). Configurations can be edited in the assembly settings editor.

(5) Create your plugin.

(6) Add the custom executable to your plug-in project and set the path to OsiriX (Project -> New Custom Executable ...).

Now you can create and run or build and debug your project. He will launch OsiriX from the product catalog for the assembly. You may also want to install OsiriX to search for packages in your build product catalog, if not already. Or you can create a symbolic link from one of the catalogs of OsiriX plug-ins into a package in your product catalog.

cd /path/to/OsiriX's/bundle/directory ln -s /path/to/build/products/YourPlugin.bundle 

This is a very standard way to create Xcode for plugin development. For example, the developers of the preferences panel will configure their own executable file for SystemPreferences.app (even in / Applications - there is no need to point to the "debug" assembly of the application).

+7
source

To debug your plugin, you must also run Osirix in Xcode. Download the Osirix source code from Github and compile it and run it. You will need to add the plugin to your list of plugins, and then when you start Xcode, your NSLog instructions from the plugin source will be printed on the Xcode console screen for the main Osirix program. I believe breakpoints also work.

0
source

My experience with Xcode is also somewhat limited, but I found that using the latest version (6.1.1), I can debug my plugin just by joining the running OsiriX process through the Debug -> Attach Process menu. This does not require you to create OsiriX from source code. I am currently using the standard (non-MD) version downloaded from their site.

Please note that you still need to restart OsiriX in order to get any changes in your plugin.

0
source

All Articles