I can reproduce the problem by starting a new, empty console application. It crashes without any changes after I select it to be a sandbox app.
I have looked at this (Sandbox activated macOS application crashes immediately after execution) thread and this (Receiving this error 'EXC_BREAKPOINT') one but neither seem to be related, or give any clues.
My crash log (attached) mentions "Unable to get bundle identifier for container id". I've added a Info.plist but it made no difference.
What is causing this?
There’s a tonne of background to this in my Resolving Trusted Execution Problems posts but, in short, you can’t sandbox a command-line tool. It’s called App Sandbox for a reason.
Why are trying to accomplish here? Why are you trying to sandbox this tool?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"