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.
If necessary, create a Developer ID Installer signing certificate in Accounts preferences.
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.
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