How to notarize Electron app for macOS Catalina (10.15)

cannot be opened because the developer cannot be verified

The app for uploading to Apple App Store, doesn’t need any notarization!

Then why is it complaining? Because only the new app uploaded to app store, Apple will notarize for you. Those previous apps on app store will all need to re-upload a new build for Apple to notarize for your app. (Yeah, I know it sounds like stupid).

production parent entitlements
production child entitlements
  1. ZIP the app
  2. Notarize the app
  3. Staple the app

Finally, I got a successful notarization and approved!

Let’s try to run our app.

What is your packaging tool?

I’m using electron-packager for its javascript support and integrated with electron-notarize, also it’s easy to apply to npm script building process, but it doesn’t matter what packaging tool you are using, it’s all about the configuration(entitlements). I’m sure you can find the exactly the same configuration in either electron-forge or electron-builder.

osxNotarize with appleId
osxSign with hardenedRuntime
unpack native node modules from afar
macos packager configuration

Test through Developer ID Distribution Application

You definitely want to test your Electron app locally on your Catalina machine. Then let’s build a distributable app first.

build a distributable app
Notarize the installer
pkg can’t be opened

More problems?

If you can successfully install the app and run without “cannot be opened because the developer cannot be verified”. Then your app has been complete notarized.

Fix the entitilements declarations

These are the basic declarations for accessing media devices, network, and file system.

Blank(white) screen?!

Below are my entitlements for reference, please note:

parent entitlements
child(inherit) entitlements

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store