Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Electron submits a wizard to the Mac App Store app


May 25, 2021 Electron


Table of contents


Since v0.34.0, Electron has allowed app packages to be submitted to the Mac App Store (MAS). The information provided by this wizard is: How to submit apps and MAS build restrictions.

Note: From v0.36.0, when the app becomes a sandbox, there will be a bug that prevents the GPU process from turning on, so v0.35.x .35.x is recommended for more views of the #3871 .

Note: Submitting an app to the Mac App Store requires attending Apple DeveloperProgram, which costs money.

How to submit

The following steps describe a simple submit application to the store method. However, these steps don't guarantee that your app will be accepted by Apple; you'll still need to read Apple's Submitting Your App's wizard on how to meet mac App Store requirements.

Get the certificate

In order to submit an app to the store, you first need to get a certificate from Apple. You can follow the existing guides .

The app signature

After you get your certificate, you can package your app using Application Distribution, and then go to Submit your app. This step is basically the same as other programs, but this key identifies each dependency of Electron one by one.

First, you need to prepare 2 authorization files .

child.plist :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
    <key>com.apple.security.inherit</key>
    <true/>
  </dict>
</plist>

parent.plist :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>com.apple.security.app-sandbox</key>
    <true/>
  </dict>
</plist>

Then use the following script to identify your app:

#!/bin/bash

# Name of your app.
APP="YourApp"
# The path of you app to sign.
APP_PATH="/path/to/YouApp.app"
# The path to the location you want to put the signed package.
RESULT_PATH="~/Desktop/$APP.pkg"
# The name of certificates you requested.
APP_KEY="3rd Party Mac Developer Application: Company Name (APPIDENTITY)"
INSTALLER_KEY="3rd Party Mac Developer Installer: Company Name (APPIDENTITY)"

FRAMEWORKS_PATH="$APP_PATH/Contents/Frameworks"

codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/Electron Framework.framework/Versions/A"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/$APP Helper.app/"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/$APP Helper EH.app/"
codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/$APP Helper NP.app/"
if [ -d "$FRAMEWORKS_PATH/Squirrel.framework/Versions/A" ]; then
  # Signing a non-MAS build.
  codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/Mantle.framework/Versions/A"
  codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/ReactiveCocoa.framework/Versions/A"
  codesign --deep -fs "$APP_KEY" --entitlements child.plist "$FRAMEWORKS_PATH/Squirrel.framework/Versions/A"
fi
codesign -fs "$APP_KEY" --entitlements parent.plist "$APP_PATH"

productbuild --component "$APP_PATH" /Applications --sign "$INSTALLER_KEY" "$RESULT_PATH"

If you're new to using the app sandbox under OS X, you should read Apple's Enabling App Sandbox carefully to get a little bit of a foundation, and then add the license keys your app needs to the licensing file.

Upload your app and check your submission

After you sign the app, you can use the app Loader to upload to iTunes link processing, making sure you've created a record before uploading . Then you can submit your app for review .

MAS build limits

To make your app sandbox meet all the criteria, the following modules are disabled when MAS is built:

  • crashReporter
  • autoUpdater

And the following behavior has changed:

  • The video acquisition function of some machines is not valid.
  • Some features are incontable.
  • Apps does not recognize DNS changes.

Also because of the use of sandboxes, the resources that the app can access are severely restricted; Read more about App Sandboxing .

The encryption algorithm used by Electron

Depending on your country and region, the Mac App Store may need to record your app's encryption algorithm, or even ask you to submit a copy of your U.S. Encrypted Registration (ERN) license.

Electron uses the following encryption algorithms:

How to get an ERN license can be found in this article: How to legallysubmit an app to Apple's App Store when it uses encryption (or how to obtain anERN). .