Notarize a macOS app from the command line.
This tool is a wrapper for xcrun altool
and xcrun stapler
and is intended for use in a continuous integration (CI) environment. Requires Xcode.
Supports notarizing app packages, disk images, and zip files.
npx notarize-cli --file build/$PRODUCT_MODULE_NAME.dmg \
--bundle-id $PRODUCT_BUNDLE_IDENTIFIER \
--username $NOTARIZE_USERNAME \
--password $NOTARIZE_PASSWORD
$ npx notarize-cli --help
Notarize a macOS app from the command line
USAGE
$ notarize-cli
OPTIONS
-h, --help show CLI help
-v, --version show CLI version
--asc-provider=asc-provider asc provider to use for app notarization
--bundle-id=bundle-id (required) bundle id of the app to notarize
--file=file (required) path to the file to notarize
--no-staple disable automatic stapling
--password=password (required) password to use for authentication
--username=username (required) username to use for authentication
Some options may be passed as environment variables.
NOTARIZE_PASSWORD
: password to use for authenticationNOTARIZE_USERNAME
: username to use for authenticationPRODUCT_BUNDLE_IDENTIFIER
: bundle id of the app to notarize
Installation is unnecessary when you run the command using npx
, but you can install it if you wish:
npm install -g notarize-cli
- Runs
xcrun altool --notarize-app
. - Runs
xcrun altool --notarization-info
in a loop until the notarization status changes. - Runs
xcrun stapler staple
if notarization is successful.