How to release a macos app written with flutter How to release a macos app written with flutter dart dart

How to release a macos app written with flutter


The procedure is very simple. But it's not properly documented anywhere.

  1. Get a certificate from Xcode. The simplest step is to use Xcode, add a new certificate. Read more about it here https://help.apple.com/xcode/mac/current/#/dev154b28f09
  2. Once you have the certificate you need to find the identity for it to sign your app .security find-identity -p codesigning run this in terminal and copy hash it gives you against the certificate name you just created.
  3. build the release version of your flutter app by running flutter build macOS in your project folderUPDATE flutter build macOS doesn't work any more. Try flutter build macos instead. Refer. Thank you @Bartosz for pointing it out in comments.
  4. cd into the folder where your app is created. now run codesign --deep --force --verbose --sign "<identity>" Application.appSupply the hash we coped in step 2 in place of (Keep the quotes).

You should see something like this Application.app: signed bundle with Mach-O thin (x86_64) [com.application]

  1. Verify the signature codesign --verify -vvvv Application.app and spctl -a -vvvv Application.app

First one will give you something like

Application.app: valid on diskApplication.app: satisfies its Designated Requirement

Second one will give you something like

Application.app: acceptedsource=Developer IDorigin=Developer ID Application: Spreaker Inc (xxx)

Read more about it https://pracucci.com/atom-electron-signing-mac-app.html

Flutter Desktop is wonderful. But coming from an Android Dev background, I had no idea how to sign in mac. Hope it helps someone.


You can simply set your signing identity in the Xcode project, using the UI or an xcconfig, as with any standard macOS application. There's nothing Flutter-specific about the signing process.