Create DMG From Applications with create-dmg [Mac]
While inbuilt hdutil
can create a dmg from app folder (Appname.app), it can’t easily be used in scripts since it requires authentications.
Fortunately, create-dmg is a beatiful little free command-line tool by awesome Sindresorhus who publishes cool little apps for Mac!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Install nodejs using brew
brew install node
# Then install create-dmg (requires nodejs >=18)
npm install --global create-dmg
# Install graphic dependencies
brew install graphicsmagick imagemagick
# Create a dmg from an app /Applications
cd ~/Desktop
create-dmg /Applications/Picview.app
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ create-dmg --help
Usage
$ create-dmg <app> [destination]
Options
--overwrite Overwrite existing DMG with the same name
--identity=<value> Manually set code signing identity (automatic by default)
--dmg-title=<value> Manually set DMG title (must be <=27 characters) [default: App name]
Examples
$ create-dmg 'Lungo.app'
$ create-dmg 'Lungo.app' Build/Releases
This post is licensed under CC BY 4.0 by the author.