This is the short release-oriented summary for Scripts/MakeUniversal.js.
For the full guide, examples, config reference, troubleshooting, and certificate notes, see:
Scripts/MakeUniversal.js can:
- build
osx-x64andosx-arm64 - merge them into one universal
.app - sign the universal
.appwithelectron-osx-sign - notarize and staple the
.appforpkg/dmgtargets - package native macOS installers:
pkgviapkgbuild/productbuilddmgviahdiutil
- build multiple installer targets in one run, such as
pkg+dmg - sign the final
pkginstaller withproductsign - use either command-line switches or a JSON config file
At minimum, the script needs:
--app-name--publish-profile-osx-x64--publish-profile-osx-arm64- a signing identity for the primary configured target unless
--no-signis used
For runs where pkg is among the installer targets and installer creation is enabled, it also needs:
--installer-identity
For runs where one or more installer targets are present (pkg / dmg), signing is enabled, and notarization is enabled, it also needs notarization credentials:
--notarize-apple-id--notarize-app-password--notarize-team-id
Example:
node "./Scripts/MakeUniversal.js" \
--app-name="ExampleApp" \
--publish-profile-osx-x64="publish-osx-x64" \
--publish-profile-osx-arm64="publish-osx-arm64" \
--sign-identity="Apple Development: Your Name (TEAMID)"Example with multiple installer targets configured in Properties/electron-builder.json:
{
"mac": {
"target": [
"pkg",
"dmg"
]
}
}node "./Scripts/MakeUniversal.js" \
--app-name="ExampleApp" \
--publish-profile-osx-x64="publish-osx-x64" \
--publish-profile-osx-arm64="publish-osx-arm64" \
--sign-identity="Developer ID Application: Your Name (TEAMID)" \
--installer-identity="Developer ID Installer: Your Name (TEAMID)" \
--notarize-apple-id="your-apple-id@example.com" \
--notarize-app-password="xxxx-xxxx-xxxx-xxxx" \
--notarize-team-id="TEAMID1234"That single run signs and notarizes the universal .app once, then creates both installers.
You can avoid passing a large number of switches by copying:
Scripts/MakeUniversal.config.template.json
to either:
Scripts/MakeUniversal.config.jsonMakeUniversal.config.json
or by pointing to a custom file:
node "./Scripts/MakeUniversal.js" --config="./Scripts/MakeUniversal.config.json"Precedence is:
command line switch > config file value > built-in default
You can inspect the fully resolved config with:
node "./Scripts/MakeUniversal.js" \
--config="./Scripts/MakeUniversal.config.json" \
--print-effective-configTarget-specific example configs are also available:
Scripts/MakeUniversal.config.pkg-dmg.example.jsonScripts/MakeUniversal.config.pkg.example.jsonScripts/MakeUniversal.config.dmg.example.jsonScripts/MakeUniversal.config.mas.example.json
Recommended starting point for direct distribution:
- copy
Scripts/MakeUniversal.config.pkg-dmg.example.json - set
Properties/electron-builder.jsonmac.targetto both"pkg"and"dmg"
The main template file, Scripts/MakeUniversal.config.template.json, also already contains both macSigning.targets.pkg and macSigning.targets.dmg, so it can be used as a generic multi-target starter as well.
If multiple installer targets are configured, MakeUniversal.js uses the first configured target as the primary signing target when resolving macSigning.targets.<target> values for the universal .app signing step.
These are practical starting points. The exact certificates Apple expects still depend on your distribution channel.
| Target | Common app signing certificate | Common installer signing certificate | Notarization | Hardened runtime |
|---|---|---|---|---|
pkg |
Developer ID Application for direct distribution, or Apple Development for local/testing |
Developer ID Installer |
Yes for direct distribution | true |
dmg |
Developer ID Application for direct distribution, or Apple Development for local/testing |
Not applicable | Yes for direct distribution | true |
mas |
Apple Distribution |
Not applicable in this script | No | false |
mas-dev |
Apple Development |
Not applicable in this script | No | false |
For pkg and dmg, a Developer ID provisioning profile is optional but may be needed when the app uses Apple Services outside the App Store. For mas and mas-dev, provisioning profiles are normally required.
For the full target-by-target explanation, see the certificate section in:
MakeUniversal.js also supports:
- optional
pkgwelcome / license resources - native notarization + stapling before packaging
- one notarization pass before building multiple installer outputs such as
pkg+dmg --no-installer/--skip-installerto skip final installer creation while keeping the universal app build--no-notarization/--skip-notarizationto keep signing enabled while skipping notarization- target-aware
electron-osx-signsettings - JSON pass-through
electron-osx-signextraOptions
The JSON config also supports:
"packaging": { "enabled": false }
to skip creating the final pkg / dmg installer.
The JSON config now stores app signing identities per target under:
macSigning.targets.dmg.signIdentitymacSigning.targets.pkg.signIdentitymacSigning.targets.mas.signIdentitymacSigning.targets.mas-dev.signIdentity
Current multi-target support is intended for installer-style combinations that share the same Electron.NET output directory family, such as pkg + dmg. Mixed combinations such as pkg + mas are not supported.
For the full documentation, use: