Debugging with Logic - CMake generated XCode project

I’ve enabled COPY_PLUGIN_AFTER_BUILD in my CMake config. It does copy the component to the relevant folder, but I can’t debug the AU as I used to do when I was still using the Projucer. Is there some trick to getting this to work? There is still a component in the build debug AU directory, I assume that this is the binary that the debugger is watching? Any ideas on how to get this working?

juce cmake should probably add

killall -9 AudioComponentRegistrar
before copying Audio unit

I asked about it some time ago already :slight_smile:

Thanks @otristan You mean it should, but as of now, it doesn’t. :frowning: This means hacking the JUCEUtils.cake, hmm, I’m not sure I want to go down that route. Might be easier to simply disable the copying and implement it myself in my own CMakeLists.txt…

I’m not having much luck with this @otristan. Did you ever find a workable solution? I thought I could just change the output directory for the AU component in XCode through the build setting below, but even this didn’t work.

Anyone have any ideas on how to proceed here?

You can call the killall -9 AudioComponentRegistrar manually after the build copy
The cmake build copy phase works fine, it’s just that if your AU wasn’t here there first, then the system won’t see it, because the AU registry do not list it.

Sorry, I should have said Logic has no problem seeing my plugin. It loads fine, but breakpoints in the plugin’s constructor never get hit. I’m using an M1 Mac and Logic 10.6 if that’s of any relevance.

I wonder should I be trying to attach the debugger to another process? Debugging plugins through Logic was never an issue in the past.

Yes, you need to attach to the sandbox process now, I forget the exact name, but it’s kind of obviously named. It’s a pain though, means you can’t just launch Logic from the build process in XCode.

edit: I also can’t remember if it behaves the same way as BitWig, where the plugin sandbox process doesn’t run until you load an actual plugin. This can be a pain if you’re trying to break in the plugin constructor since you need to load some other plugin first in order to get the sandbox process available to attach to.

Thanks @asimilon @otristan, the process is called AUHostingService. According by this thread it seems that if you want to debug a plugin developed with an Apple SDK, in an Apple host, with an Apple IDE, with the latest Apple hardware running the newest Apple operating system, you must first disable system integrity. Wow, even for Apple that’s quite something.

It’s kind of ironic that they named their flagship DAW Logic.