Releasing an Electron app on the Mac App Store

This week I released an Electron app on the Mac App store. Since this isn’t the traditional process of building macOS apps, it’s not well documented and the instructions that do exist tend to contradict one another. This article is a path that what worked for me, but may not be the best one out there.

The build process.

To create a pkg file that I could eventually upload, I used electron-builder. Many tutorials out there suggest using electron-packager, however they often were written before electron-builder became a thing so I wouldn’t recommend going this approach. Electron builder is an all-in-one tool that will make your life much easier.

Electron builder has you add a parameter to your package.json called build. My full package.json looks like this:

The first thing you’ll need is your appId. You can register this id on the Apple Developer portal under “Certificates, Identifiers & Profiles” and then click the dropdown, select OS X (funny that Apple hasn’t changed this to macOS yet) and then “App Ids”. Or you could just click this link.

Next, you’ll need to set your mac options, starting with a category. All mac options are defined here. You can see all category options here. Then, you should set your target.

Make sure to set mas as a target. When you eventually run your build, the mas version of the app will be what you submit to the Mac App Store (mas).

Entitlements and the File Structure

Electron-Builder looks for a build folder in your root directory where you should put a couple important files. There’s a few different ways to do this, but I had four main files in there.

I had two .plist files for my entitlements: entitlements.mac.plist and entitlements.mas.plist .

The mac plist looks like this:

And the mas plist looks like this:

But you should replace the with your own developer id followed by your app id in the format <dev_id>.<app_id> .

I also had an info.plist file that looked like this:

Again, replace the dev team id and app id with your own.

Finally, I had an icon.icns file which was the logo for my app.

The icon for my app.

The Provisioning Profile.

In the Apple Developer portal, I grabbed a Mac Distribution provisioning profile. This will give you a .provisionprofile file that you should download and save in the root of your project as embedded.provisionprofile .

Code Signing

I generated 5 different certificates on the Apple Developer portal:

  • Mac Developer
  • Mac App Distribution
  • Mac Installer Distribution
  • Developer ID Application
  • Developer ID Installer

Then, I downloaded all the certificates and double clicked them so they would open in Keychain Access on my Mac. Then, I cmd-clicked all five certs, right clicked, and then clicked “Export 5 items”. This will generate a .p12 file that will ask you for a password.

Then came the actual code signing. Code signing is a really annoying process. So I wrote a script to do it. You’re welcome to use it as well if you’d like. Make sure you store your .p12 file in ~/.certs .

Setting up scripts

To make things easy on myself, I edited the scripts section of my package.json to add two scripts:


Finally, I ran npm run release and my scripts created a dist folder that contained all my deliverables. I then used Application Loader to deliver my app build to iTunes Connect.

Developer of a bunch of things.

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