Reveal more

Signing Max Msp Applications for macOS

TL;DR
Make sure your an identified apple developer, put your mac app ID in your standalone object and sign the app running:
codesign -f -s “Developer ID Application: Your Name” /Users/Nicco/Desktop/Your_App_Name.app –deep
on your terminal. Job done.

Real life scenario…

scene

You have just finished coding wonderful audio app using the latest Max Msp build (yes, I still call it Max Msp because it’s the best way to distinguish it from all the other Maxes around), and you can’t wait to send it over to your friends to try it before you release it to the world.

You’re in luck, your friend is right by your side. You put the app on a USB stick, you pass it to him and bam! In a moment, your gorgeous UI fires up on his machine and everything runs smoothly. Confident of the result of your first beta testing, you release it and put a download link for the app on your website. Little did you know that the app would not work on any other machine!

scene

The issue

So… drama aside. You might have noticed that if you send your max msp app to a friend, you might incur into something like:

or even worse

Y

Rejoice! Your app is not corrupt! The problem has to do with app signing. Apple prevents people from opening malicious software this way. Since macOS Sierra, Apple decide to remove the «Anywhere» option for downloaded Apps in the Security & Privacy settings. There are 2 main workarounds, and unfortunately one will cost you some money.

The janky workaround

sudo spctl –master-disable

Type this in your Terminal.app, when prompted type your password, and magically the “Anywhere” option will reappear in your preferences. Unfortunately this is a janky workaround for two reasons:

  1. You’re not the one who has to type the command in the Terminal.app. Asking your users to open the Terminal could be intimidating, most of all if your app is not tailored to tech savvy people.
  2. It’s not going to stick. With every (or almost every) update, the preferences will be reset and you will have to ask your users to re-type the command in the Terminal after every update

The official solution

To solve the issue in the official way, you will have to be an Apple Developer with an active Apple Developer Licence. You can purchase the licence for a yearly price of 79£ (or 99$) from here.

Once that is done, you will have to generate two things:

  1. An Apple Developer Certificate, that you will have to install and store in your keychain (brief how-to explanation here)
  2. A Mac App ID. Apple usually suggests the com.COMPANYNAME.APPNAME format. On your apple developer account page you’ll be able to easily generate one by going on the Identifiers – App IDs section.

Once you’re all set, the rest is pretty straightforward. First of all you will have to insert your Mac App ID in your Max App by editing the preferences in the inspector window of your standalone object.

Once that is done, you need to save your patch, export your app as an application and run this command on your terminal:

codesign -f -s “Developer ID Application: Your Name” /Users/Nicco/Desktop/Your_App_Name.app –deep

This will sign your app and you will finally be able to distribute it to other users!

Appendix

I wrote this blogpost because it took me a while to figure this out, and I did a lot of unnecessary steps to reach this point. The above guide works only if you are planning to distribute the app outside the App Store, and you don’t need to notarize it. If you don’t know what notarizing is, then you definitely don’t have to do it.

If, however, you were planning to release your app on the app store, Josh Stoval opened an amazing thread on the Cycling ’74 forum that goes in great detail in every step of the way.
Max Standalone in the Mac App Store (2018)

Similarly if you just needed to sign and notarise your app, Dan Nigrin opened another similar thread again on the Cycling ’74 forum, place where I was also guided in my discoveries shared in this post.
Apple notarizing for Mojave (10.14) and beyond

Happy signing!

Leave a Reply

*

Next post Shut-Up & Write/Work
Portraits by Camilla Bach
Sketches by Elisa Gandolfo