mac configuration contains options for building macOS targets. These options apply to all macOS target types including DMG, PKG, and MAS.
macOS Targets Overview
DMG
Disk image format for direct distribution
PKG
macOS installer component package
MAS
Mac App Store distribution target
Base macOS Configuration
Themac key in your electron-builder configuration applies to all macOS targets:
For detailed macOS configuration options, see the MacConfiguration interface reference.
DMG Configuration
Thedmg key configures Apple Disk Image builds for direct distribution to users.
Basic DMG Example
- JSON
- YAML
DMG License
To add a license agreement to your DMG, create license files in your build resources directory:Create license files
Create files named
license_LANG_CODE.txt in your build resources directory. For example:license_en.txt(English)license_de.txt(German)license_ru.txt(Russian)
Customize button labels (optional)
Create
licenseButtons_LANG_CODE.json files to customize button labels:Build
The appropriate license will be displayed based on the user’s OS language. See the ISO 639-1 language codes for supported codes.
For complete DMG configuration options, see the DmgOptions interface reference.
PKG Configuration
Thepkg key configures PKG installer builds for macOS.
Basic PKG Example
PKG installers require macOS code signing. For complete PKG configuration options, see the PkgOptions interface reference.
MAS Configuration
Themas key configures Mac App Store (MAS) builds. This target inherits all base macOS options.
MAS Example
- JSON
- YAML
MAS Entitlements
Mac App Store apps require specific entitlements. Createentitlements.mas.plist:
MAS builds require an Apple Developer account, provisioning profiles, and App Store certificates. For complete MAS configuration options, see the MasConfiguration interface reference.
Building Multiple Targets
You can build multiple macOS targets in a single build:- CLI
- package.json