Debugging on AU Plugin in Logic on Xcode

I followed some tutorial (https://www.youtube.com/watch?v=YwmE82RgTNM&t=318s&ab_channel=DrBruisin) on how to use Xcode to debug a AU plugin loaded in Logic Pro. The plugin seems to load / execute fine, but I got no breakpoints / assertions / DBG messages. This gives me the impression that there may be something wrong with the symbols or debugging connection.

The setup was very quick and easy:

  • Create a “Basic Plugin” project in Projucer, I didn’t really change any code so far
  • Export a Xcode project with Debug Settings
  • Use the “Edit Scheme” to assign “Logic Pro.app” as the debug Target
  • Build and execute

If I run on “My Mac”, Logic starts, and I can load my plugin and it’s shown
If I try to run on “My Mac (Rosetta)”, Logic starts as well (after a confirmation about Rosetta), but Logic is unable to find my plugin. It’s not show in the list, and if I load a Project with the plugin assigned, I get the Can’t find plugin error.

Anyone has that issues?
Anyone knows how I could get at least the DBG messages show somewhere?

My System Information:

  • Mac Book Pro 2021 / Apple M1 Pro / macOS 15.5 (24F74)
  • Logic Pro 11.1.2
  • Xcode 16.3
  • JUCE Version 8.0.7

Bitwig and Logic are a pain to try and debug because of them running plugins in a sandbox process.

iirc with Bitwig you can at least attach to the process manually and get breakpoints at least, I seem to recall this wasn’t possible with Logic, but you definitely won’t get DBG statements from either.

I’ve resorted to logging to a file and tail -f in Terminal to see the output immediately as a work around. It would be really nice if there was a #define flag to re-route DBG to a file when needed.

You can do the following in the constructor of your AudioProcessor:

std::freopen("/path/to/logfile.txt", "w", stderr);

Now DBG will write to the file. (Mac only since Windows doesn’t write to stderr.)

2 Likes

Thank you. I now also use logging. It’s more cumbersome, but I’ll have no other chance I guess at this point…