Updated 2012-11-05: Added note about codesign tool working with 10.6, 10.7 and 10.8.
With the release of OS X 10.8 Mountain Lion last month, the new GateKeeper functionality is now in effect. This means that new apps that are downloaded or copied to a Mac with Mountain Lion, but that are not digitally signed using your Apple Developer Certificate, display this error when run on Mountain Lion:
|Mountain Lion Error for Unsigned Applications|
This error can be overridden in System Preferences, by changing the "Allow applications downloaded from" setting to "Anywhere":
|Security & Privacy System Preferences|
And you can right-click on the app and click Open in the menu to tell OS X, "I'd really like to run this app, thank you very much."
Note that this only matters for new apps that you transfer to a Mac running Mountain Lion. If you have Real Studio running on Mountain Lion, you'll be able to run the apps you create just fine. You'll only run into this warning when you copy the app to another Mac, either by making it available for download or by copying it via a USB stick, the network or anything else.
So even though you don't technically need to sign your OS X applications in order for them to run on Mountain Lion, you are probably going to want to. The truth is that most people will just leave the setting at the default and will not know that when they get the warning message that they can right-click on the app to open it. You could try explaining all this to them, but either way it is going to be a hassle for your users. Odds are they just won't bother with your app.
Unfortunately, to sign your apps you need a developer certificate from Apple. And the only way to get a Developer Certificate is to sign up for the Mac Developer Program, which costs $100 a year. However, the certificate you get is good for 5 years, so it looks like you do not need to pay the $100 fee each year unless you also want to distribute apps in the Mac App Store.
You can find out more about the Mac Developer Program at the Mac Dev Center:
Once you have joined, you can create your own certificates using the Developer Certificate Utility at the Mac Dev Center. The steps are a bit involved, but essentially you will request a Developer ID certificate on this page:
|Developer Certificate Utility page at the Mac Dev Center|
And then the Utility walks you through the process of starting KeyChain Access and downloading and uploading files until you have the certificate installed. It's a little tedious, but relatively straightforward.
That's the hard part. With the certificate installed, you can now use it to code sign any of your applications. You do this using the Terminal command codesign (pronounced "code sign").
But before you begin, make sure you have the Intermediate Developer ID certificate installed. Go to this page:
and download the Developer ID certificate. Double-click it to install it into Keychain Access.
Now you are ready to code sign your Real Studio application. Navigate to its folder using Terminal. There you can enter this command to code sign your application and all its libraries. Obviously you want to replace "YourRealStudio.app" with the name of your application and "Developer ID Application: YourName" with the name of your signing certificate specified in Keychain Access.
codesign -f -s "Developer ID Application: YourName" "YourRealStudioApp.app"
That's it. Now you can compress your app and transfer it to another computer with Mountain Lion and you'll be able to run it just by double-clicking on it.
Here is a sample application that I've code signed using the above process. Feel free to try it out:
If you are having trouble with these steps, one thing you might try is to download and install the Command Line Tools for either Lion or Mountain Lion.
You can use the codesign tool on Snow Leopard (10.6), Lion (10.7) and Mountain Lion (10.8) in order to sign your apps for Mountain Lion.