I have a flutter app which I built in Flutter for macOS. But I cannot figure out a way to codesign the Application.app package. I have searched the internet and couldn't get a proper way to do it.
macOS supports developing Flutter apps for iOS, Android, macOS itself and the web. Complete at least one of the platform setup steps now, to be able to build and run your first Flutter app.
Flutter is a multi-platform application development framework that enables you, among other platforms, to develop iOS and Android apps from the same source code. However, you need to use Xcode to build an iOS app and Xcode will only work on macOS.
The procedure is very simple. But it's not properly documented anywhere.
security find-identity -p codesigning
run this in terminal and copy hash it gives you against the certificate name you just created.flutter build macOS
in your project folder
UPDATE flutter build macOS doesn't work any more. Try flutter build macos
instead. Refer. Thank you @Bartosz for pointing it out in comments.cd
into the folder where your app is created. now run codesign --deep --force --verbose --sign "<identity>" Application.app
Supply 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]
codesign --verify -vvvv Application.app
and spctl -a -vvvv Application.app
First one will give you something like
Application.app: valid on disk
Application.app: satisfies its Designated Requirement
Second one will give you something like
Application.app: accepted
source=Developer ID
origin=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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With