Brendan Dawes
The Art of Form and Code

Code Signing Processing Exported Apps

I recently discovered an issue with sending an exported Processing app to someone via the Internet and wanted to make a note of the solution, mainly for myself, but also in the hope it may be useful to you too.

When you export an app on a Mac from Processing you'll notice some text at the bottom of the export window warning about code signing. By default the app is self-signed by the Processing app. This is normally all fine as the app will run perfectly well. You can put it on a USB key and pass it to someone else and it will run fine for them too. The problem occurs though when you try and send that app to someone over the Internet. Apple's Gatekeeper will kick-in and tell you the app is corrupted and should be moved to trash.

No matter if you zip the file up or make a DMG, Gatekeeper will say the file is corrupted if it's been delivered via the Internet, be that FTP, Dropbox, email or whatever else.

The solution is to sign the app yourself which means having an Apple Developer account, installing the necessary tools, downloading a certificate and then signing the app via the command line. Bit of a pain but here's how to do that.

If you're not already signed-up into the Apple Developer program sign-up. It'll cost $99.

Download the command line tools which we'll need to code sign in a moment.

On the Developer portal create a new certificate and follow the instructions. Download the certificate and double-click it to install it. This is the certificate we'll use to sign our app.

In the Terminal navigate to where you exported your app. Type this in the Terminal making sure to use the name of your certificate and the name of your app.

codesign -f -v -s "Developer ID Application: Name Of Your Certificate"

The Code Sign app that was installed via the command line tools you downloaded earlier, will sign your exported Processing app. You can now distribute the app over the Internet. This should now open fine on other people's computers.