Mac Code Signing and Notarization
To distribute a Mac app to other people it needs to be code signed and notarized by Apple, otherwise macOS will refuse to open it. This needs Xcode’s command line tools, so it can only be done on a Mac.
Eto.Forms can sign, notarize and package your app into a .dmg as part of a release build, for both the Mac64 and macOS platforms:
Get an Apple Developer account.
Install your Developer ID Application certificate in your keychain. On GitHub Actions,
apple-actions/import-codesign-certsworks well.Create an app-specific password for your Apple account.
Store your notarization credentials in the keychain under the name
AC_PASSWORD:xcrun notarytool store-credentials "AC_PASSWORD" --apple-id "<your Apple ID>" --team-id "<your Team ID>" --password "<app-specific password>"Turn it on in your
.csproj:<PropertyGroup Condition="$([MSBuild]::IsOSPlatform(OSX)) AND $(Configuration) == 'Release'"> <EnableCodeSigning>True</EnableCodeSigning> <EnableNotarization>True</EnableNotarization> <EnableDmgBuild>True</EnableDmgBuild> </PropertyGroup>Build:
dotnet build -c Release
Options
| Property | What it does |
|---|---|
CodeSigningKey | Which certificate to sign with, if you have more than one. Any part of its name, or its SHA-1. |
NotarizationKeychainProfile | The keychain profile from step 4, if you used a name other than AC_PASSWORD. |
EnableNotarizationStapler | Set to False to skip waiting for notarization to finish. The app still runs for users who are online, but the build is much faster. |