Search code examples
macoselectronelectron-builderelectron-packagerelectron-forge

How to sign and notarize an electron application build using visual studio code for macOS for outside mac app store?


I've created an electron application using visual studio code to publish outside mac app store. Before the macOS 10.14.4 release, my application was build and signed successfully using electron-osx-sign module which uses electron-forge internally. Now after macOS update I'm getting error message while building the application as - "rejected source = Unnotarized Developer ID".

I'm finding solutions available for application build in Xcode all over the internet but there is no specific solution for applications build in visual studio code using javascript.

The command I'm using to create a build for my macOS :

"electron-packager . appName --overwrite --platform=darwin --arch=x64 --electron-verison=5.0.1 -icon=icon.icns --osx-sign"

Kindly provide with your inputs for any possible solution.

enter image description here


Solution

  • TL;DR

    For me, changing the password to app specific password resolved this error.

    Explanation

    App Store Connect now requires two-factor authentication (2FA) on all accounts, so you must create an app-specific password for Notarisations tools also.

    How to create app-specific password: https://support.apple.com/en-us/HT204397)

    Why you need app-specific password: https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow?language=objc#3087734

    (By the way, the “Unnotarized Developer ID” warning will still be showing because electron process checks the staple before notarizing, but then it will continue and the build will complete)