Search code examples
xcodedebuggingpluginsmayalldb

How to debug Maya plugin with Xcode?


I have a Maya 2019 Plugin that I want to step through in Xcode 11.4's debugger. Even though I can attach to the Maya process and see the output from the plugin in Xcode's console (and in the terminal if I launch Maya from there) the plugin breakpoints are never reached. Does anyone have detailed steps for setting this up?

These are some resources I've already looked at:

http://www.sonictk.com/post/tutorial-debugging-maya-plugins-crossplatform/

https://medium.com/@yuping37/write-a-custom-skinning-maya-plugin-and-debug-with-xcode-8de6512b494d

Debugging Maya Plugin with Xcode


Solution

    1. Go to the product menu in Xcode and select "Edit Scheme"
    2. In the Edit Scheme screen’s input field for Executable, select “other”. This will open a screen titled “Choose an executable to launch” to browse for the path to maya. Leave this screen open.
    3. Open the Mac Finder app and navigate to Applications, right click on Maya and select “Show Package contents". Navigate to the package's /Contents/bin/ folder and select maya unix executable and drag it to the “Choose an executable to launch” screen opened in step 2. Then close.
    4. Go to Build Settings set "Generate Debug Symbols" to YES. Debugger should now work when running or Attaching to process by PID or Name.