Xcode debugger not working

Hi all,
I can’t get the Xcode debugger to work on any of my juce projects, including those
I am on the latest versions of Catalina OS (10.15.2) and Xcode (11.3). Inserting breakpoints does not stop the program at all and on the left panel it is said “No debug session”.
What I am missing?

Did you choose an executable to launch from the “Edit Scheme…” option where you have the build targets in XCode?

image

in the window that pops up you need to set Executable to some sort of host (a lightweight one will speed up your development, I tend to use Hosting AU when it’s just GUI stuff I want to debug, or Reaper when a proper DAW required), it will then be launched when you press the Play button (or Cmd-R)

Then add your plugin and you’ll hit any breakpoints (or the debugger will show you where you crashed if that’s what you’re trying to debug).

This took me far too long to work out when I started out on JUCE development. :smiley:

Or alternatively connect the debugger to a running application:
Menu->Debug->Attach to Process->select your DAW running your plugin from the list

Many thanks! I can make it work with the Hosting AU but not with Ableton Live Suite 10 (latest version and updated): Xcode complains with this error:

Could not attach to pid : “28147”

Domain: IDEDebugSessionErrorDomain

Code: 3

Failure Reason: Error 1

Error 1

Domain: IDEDebugSessionErrorDomain

Code: 3

I searched online and this post https://forums.developer.apple.com/thread/120282 recommends to launch sudo DevToolsSecurity -enable which did not solve the problem for me…
Has anybody met the same issue and knows how to solve it?

Cheers

This is because of hardened runtime (and its associated entitlements), which is required for notarization.

You can read from

or jump directly to a solution

6 Likes

Thanks a lot, it works

You are the real MVP!

1 Like

Has anyone got plugin debugging with Ableton from XCode working on an M1 Mac running Monterey?
Every time I run this debug entitlement script:

The codesign fails for me with the related error output:

Re-applying entitlements (if missing)...
/Applications/Ableton Live 11 Suite.app: replacing existing signature
/Applications/Ableton Live 11 Suite.app: resource fork, Finder information, or similar detritus not allowed
codesign failed!

Just found the solution:
I had to run xattr -rc "/Applications/Ableton Live 11 Suite.app" before running ./add_debug_entitlement.sh "/Applications/Ableton Live 11 Suite.app".

Solution from:

2 Likes

Thanks for this thread!
Just helped me out debugging in Ableton :slight_smile:

1 Like