Notorize .app with a Shell Script Main Executable

Viewed 184

According to Apple's documentation on "What to Code Sign", shell scripts are not 'code', and are therefore a resource. It goes on to say about shell scripts "While it's possible to sign such executables and store them in Contents/MacOS, this is not recommended."

My question is, what should I do if my app's main executable IS a shell script? I tried putting my script into /Resources and added a symlink in MacOS, but I got the main executable or Info.plist must be a regular file (no symlinks, etc.) Do I need to do something drastic like port the entire shell script to C?

1 Answers

First of all, you need to consider why do you want to notarize your script. Notarization is an Apple servers-side verification, that you are a certified developer with some name, and it is really you, who signed some bundle.

This is needed only if you want to distribute your app to other users, and I would say in your case it is only appropriate if you want to distribute this in appstore, because otherwise you could just post a script and let your users to download it and run.

If you are shure you need this and want to distribute script as an application, try this asnwer

TLDR: place script named without any extension into MyBundle.app/Contents/MacOS and add into Info.plist the CFBundleExecutable key with script name in value.

After that, code signing and notarization should be the same as for any other bundle.

Related