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:

  1. Get an Apple Developer account.

  2. Install your Developer ID Application certificate in your keychain. On GitHub Actions, apple-actions/import-codesign-certs works well.

  3. Create an app-specific password for your Apple account.

  4. Store your notarization credentials in the keychain under the name AC_PASSWORD:

    Shell
    xcrun notarytool store-credentials "AC_PASSWORD" --apple-id "<your Apple ID>" --team-id "<your Team ID>" --password "<app-specific password>"
  5. Turn it on in your .csproj:

    XML
    <PropertyGroup Condition="$([MSBuild]::IsOSPlatform(OSX)) AND $(Configuration) == 'Release'">
      <EnableCodeSigning>True</EnableCodeSigning>
      <EnableNotarization>True</EnableNotarization>
      <EnableDmgBuild>True</EnableDmgBuild>
    </PropertyGroup>
  6. Build:

    Shell
    dotnet build -c Release

Options

PropertyWhat it does
CodeSigningKeyWhich certificate to sign with, if you have more than one. Any part of its name, or its SHA-1.
NotarizationKeychainProfileThe keychain profile from step 4, if you used a name other than AC_PASSWORD.
EnableNotarizationStaplerSet to False to skip waiting for notarization to finish. The app still runs for users who are online, but the build is much faster.