Still possible to use XCode for local MacOS development without a bundle identifier?

I have used XCode for decades as my default C/C++ programming IDE. I write code that I run locally on my Mac, via "Sign to run locally". Typically this has always "just worked".

I am now using MacOS 14.7 Sonoma, and I suddenly find I cannot run my code projects because I cannot dynamically load unsigned libraries. "not valid for use in process: library load disallowed by system policy"

BUT - it appears that to allow my local MacOS code to bypass this requires I have a bundle identifier to modify entitlements. Which in turn requires a developer account which I don't have.

Is this all correct? Is there any way to have code run locally and use dynamic libraries as I've done previously? Any advice is much appreciated.

Answered by DTS Engineer in 827415022

Sign to Run Locally is Xcode’s term for ad-hoc code signing. It’s possible to use it for large, sophisticated code bases. Indeed, if you use products installed by Homebrew, you’ll find that they’re all ad-hoc signed.

Whether you should continue to do this depends on your goals:

  • If you’re building Unix-y stuff then it might make sense to stick with ad-hoc signing.

  • OTOH, if you’re building Mac-y stuff then it definitely makes sense to switch to a stable code-signing identity. Critically, you need that to work reliably with privacy alerts, as described in TN3127 Inside Code Signing: Requirements.

If you stick with ad-hoc signing then it probably makes sense for you to disable the hardened runtime. That’ll get you past the “library load disallowed by system policy” problem.

Finally, switching to a stable code signing identity doesn’t require you to have a paid Apple Account. You can sign in to Xcode with any Apple Account. If that account isn’t a member of a paid team, Xcode shows it as a Personal Team [1].

ps None of this is related to bundle IDs. Like darkpaw, I’m a bit mystified as to why that changes things for you.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] The Personal Team feature has significant limitations, but those are mostly relevant to iOS. For the details, see Developer > Support > Choosing a Membership.

You can do most things without a Developer account, and I can't see why you would need to pay $99/year to run code locally.

Can you show us where it says you have to have a bundle identifier?

Sign to Run Locally is Xcode’s term for ad-hoc code signing. It’s possible to use it for large, sophisticated code bases. Indeed, if you use products installed by Homebrew, you’ll find that they’re all ad-hoc signed.

Whether you should continue to do this depends on your goals:

  • If you’re building Unix-y stuff then it might make sense to stick with ad-hoc signing.

  • OTOH, if you’re building Mac-y stuff then it definitely makes sense to switch to a stable code-signing identity. Critically, you need that to work reliably with privacy alerts, as described in TN3127 Inside Code Signing: Requirements.

If you stick with ad-hoc signing then it probably makes sense for you to disable the hardened runtime. That’ll get you past the “library load disallowed by system policy” problem.

Finally, switching to a stable code signing identity doesn’t require you to have a paid Apple Account. You can sign in to Xcode with any Apple Account. If that account isn’t a member of a paid team, Xcode shows it as a Personal Team [1].

ps None of this is related to bundle IDs. Like darkpaw, I’m a bit mystified as to why that changes things for you.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] The Personal Team feature has significant limitations, but those are mostly relevant to iOS. For the details, see Developer > Support > Choosing a Membership.

Still possible to use XCode for local MacOS development without a bundle identifier?
 
 
Q