Sign a Mac Installer Package with a Developer ID certificate

If you want to distribute your macOS app as a Mac Installer Package, then sign the package with a Developer ID Installer certificate.

For details on code signing from the command line, read Code Signing Guide.

  1. If necessary, create a Developer ID Installer signing certificate in Accounts preferences.

  2. Code sign the installer package with the Developer ID Installer certificate using the productsign(1) command-line tool.

    WARNING: Make sure you sign the installer package using your Developer ID Installer certificate. The productsign(1) command-line tool allows you to sign an installer package using your Developer ID Application certificate. Although this approach may appear to work, the resulting installer archive will fail on the destination Mac.

  3. Test your installer package using the spctl(8) command-line tool.

    Enter this command but replace MyPackageName.pkg with the filename of your package:

    spctl -a -v --type install MyPackageName.pkg
See alsoDistribute outside the Mac App Store (macOS)Test a Developer ID-signed appEnable and disable Developer ID apps and Gatekeeper