_CodeSignature Folder for Console Apps?

I’ve just built my first console app on macOS for a while. The output of the build is:

MyApp Libs

The _CodeSignature folder is new since the last time I built the app. I’m using Xojo 2022r2.

What do I do with this folder? Does it need to be copied over to all Macs that want to run the console app?

Seems garbage. Temporary content not deleted?

Codesigning an .app creates this folder inside the .app
Codesigning a console executable doesn’t, the signature is appended to the binary executable.

Issue needing reporting? Who’s the macOS guy these days for us to ask that? :smiley: @Paul_Lefebvre ?

It’s because Apple’s code sign thinks your application is a bundle (which it isn’t), I spent a lot of time working around this with App Wrapper (especially when Xojo was creating “Resources” folders).
Without the “Resources” folder, my guess is that Xojo is still doing something to the executable that gives Apple the impression that this is a bundle and not a single file executable.

The only way to know for sure is to try it, do you have non-executable files in the “Libs” folder.

I downloaded the pre-compiled binary for macOS and it won’t run because of code signing issues. I used Permissions Reset to strip quarantine and then it worked.

Did you use App Wrapper to code sign the application?

I think I’ve answered my own question…

Code signing on Mac is a nightmare.

Whenever I build the tool (xojotool - I released it in another post on the forum yesterday) Xojo spits out the _CodeSignature folder. I don’t use any developer certificate with the Xojo IDE.

I think I have managed to get the tool to sign correctly with your AppWrapper (nobody has complained yet about permissions issues yet).

One thing I couldn’t get working (even with your AppWrapper) was to set it up with homebrew. I’d love to do some sort of short YouTube video with you Sam walking through how to properly sign this stuff.

Is the code signature an ad-hoc one? Then you want to add your thumb to Xojo: Account Login .

A couple of things.

  1. I’ve not used homebrew, so don’t know why it may not work, sorry.
  2. No-one wants to see a video of me, let alone one of me walking :wink:

Signing Xojo console apps is a bit janky, because the process is a bit janky. I wrote the console signing capabilities before I knew who I now know inside of Apple, back then the official ways for either an application bundle or a single file executable. IIRC it took a long while to figure out how to do it that would appease codesign, spctl and then notarization.

  1. Drag the main application into a new App Wrapper window. Configure the bundle identifier.
  2. Then drag the libs folder into the listbox below the bundle identifier field.
  3. Wrap, Pack and Notarize.

By default, the Xojo IDE now applies an ad-hoc code signature by default for macOS builds no matter what kind of build you’re doing, ARM or Intel. If you have a certificate on your machine, you can put the identifier in the Sign step and it will sign the bundle for you. If you do not want your package to be signed, you can enter an invalid identifier, like zzz.

Thanks @Greg_O. That causes a warning popup at the build step but after dismissing it, the app builds and the _CodeSignature folder no longer gets created.

1 Like