Sign your Qt Mac OS X App for preventing 'unidentified developer' message

Starting from Mac OS Lion (10.8) / Mavericks (10.9) Apple requires certificate to start application. Without that certificate customers will see following error message:

"MyApplication" can't be opened because it is from an unidentified developer.

To start such application customers should either disabling Gatekeeper security or making an exception. To make an exception - hold Ctrl key and Open the application.


To solve this error message it’s necessary to do following steps:
1. Register in Apple dev program ($99/year)
2. Download and install developer certificate
3. Sign application and all libraries + qt framework


Now you need to sign your application including all plugins and frameworks inside app bundle. After you sing your app, you can’t do any changes in the bundle. So as first run your deploy as usual and as last step do app singing.


Qt App sign script:
#sign app
codesign --force --verify --verbose --sign "Developer ID Application: My DEVID" ./MyApplication.app

#sign all *.dylib
find MyApplication.app -name *.dylib | xargs -I $ codesign --force --verify --verbose --sign "Developer ID Application: My DEVID" $

#sign Qt frameworks
find MyApplication.app -name Qt* -type f | xargs -I $ codesign --force --verify --verbose --sign "Developer ID Application: My DEVID" $


"Developer ID Application: My DEVID" - your development ID

MyApplication - your Application name