@roeybiran/distribute-macos-app
v1.3.0
Published
A command line tool for distributing macOS applications
Readme
Distribute macOS App
A command-line tool that builds, exports, signs and notarizes a macOS application.
Work in progress!
Usage
npx -y @roeybiran/distribute-macos-app release \
--scheme MyApp \
--keychain-profile notary-profileOptional release output:
--out-dir path/to/releases
Optional DMG customization:
--dmg-background path/to/background.png
Fast local DMG preview with the unsigned DUMMY.app fixture:
npm run build && node dist/index.js preview-dmg \
--dmg-background /absolute/path/to/background.png \
--revealDMG Backgrounds
- The DMG icon layout is explicit, not automatic.
- The app icon center is currently placed at
(192, 240)when no custom background is used. - The
/Applicationslink center is currently placed at(448, 240)when no custom background is used. - The default icon size is
80. - The
xandyvalues are relative to each icon's center. - The horizontal gap between icon centers is
256 pt. - With the default
80 pticon size, the visible gap between the two icon edges is176 pt. - Without a custom background,
appdmgfalls back to its default window size of640x480, so the default iconyposition is240. - If you provide
--dmg-background, the tool passes it straight through toappdmgwithout inspecting its size. - The icon layout stays point-based, so with or without a custom background or
@2xsibling the iconyposition remains240. - For backgrounds that line up with the default layout, use
640x480for the base image and1280x960for an optional matching@2ximage. - For Figma, make the frame the exact pixel size you want the DMG window to be, leave clear space around those two icon centers, and keep extra room below each icon for the Finder label text.
- If you want a retina background, export a matching
@2xasset next to the base image, for examplebackground.pngand[email protected]. preview-dmgalways uses the built-inDUMMY.appfixture, skips code signing and notarization, stages the fixture app in a temp directory, and leaves only the final DMG in the chosen output directory.
Generate Sparkle files as part of the same release flow:
npx -y @roeybiran/distribute-macos-app release \
--scheme MyApp \
--keychain-profile notary-profile \
--sparkle \
--out-dir releasesWhen --sparkle is enabled, the source directory must include a CHANGELOG.md file. Use ## VERSION - YYYY-MM-DD headings for released versions. The tool writes each released version to a same-basename markdown file next to the built DMG files, writes the full public history to release-notes.json, and generate_appcast picks up the per-version markdown files as release notes for their matching archives.
Without --sparkle, --out-dir changes where the versioned export folder is created. That folder includes the exported .app, its .dSYM, and the final .dmg.
Read More
Distribution
- Distribution — Apple Developer Documentation
- Notarizing macOS software before distribution — Apple Developer Documentation
Signing
Notarization
To create a new credential profile, run:
xcrun notarytool store-credentials "${profile}" --key PATH_TO_PRIVATE_KEY --key-id KEY_ID --issuer ISSUER_ID
Generating the profile can be done through App Store Connect. Learn more.
- Customizing the notarization workflow — Apple Developer Documentation
- Customizing the Xcode archive process — Apple Developer Documentation
- Notarize a Command Line Tool with notarytool — Scripting OS X
Archiving, Building, Exporting
- Technical Note TN2339: Building from the Command Line with Xcode FAQ
- How to build an iOS app archive via command line
- Build iOS apps from the command line using xcodebuild
- Full Stack iOS Continuous Delivery with xcodebuild and ExportOptions Plist
