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:

1 Like

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:

3 Likes

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

1 Like

Resurrecting this thread - I’ve had that script working fine for the last year or so, but now it tells me “Operation not permitted” (I tried with sudo as well)

Could something have changed in a recent macOS security update? I’m on Ventura 13.4

This is the output:

Grabbing entitlements from app...
Executable=/Applications/Ableton Live 11 Suite.app/Contents/MacOS/Live
Warning: Specifying ':' in the path is deprecated and will not work in a future release
Patch entitlements (if missing)...
Add: ":com.apple.security.cs.disable-library-validation" Entry Already Exists
Add: ":com.apple.security.cs.allow-unsigned-executable-memory" Entry Already Exists
Re-applying entitlements (if missing)...
/Applications/Ableton Live 11 Suite.app: replacing existing signature
/Applications/Ableton Live 11 Suite.app: Operation not permitted
codesign failed!
Removing temporary plist...