-
Notifications
You must be signed in to change notification settings - Fork 115
Command Line Interface
As of version 1.3 AutoDMG has a command-line interface. It's targeted at users who wish to automate builds and exposes some advanced functionality that isn't (yet?) available in the GUI.
You can start AutoDMG by executing the binary inside the app bundle and giving it an argument (without arguments the GUI launches). For example -h
will show you the usage:
termos:~ user$ /Applications/AutoDMG.app/Contents/MacOS/AutoDMG -h
usage: AutoDMG [-h] [-v] [-L LEVEL] [-l LOGFILE] [-r]
{build,download,list,update} ...
optional arguments:
-h, --help show this help message and exit
-v, --verbose Verbose output
-L LEVEL, --log-level LEVEL
Log level (0-7), default 6
-l LOGFILE, --logfile LOGFILE
Log to file
-r, --root Allow running as root
subcommands:
{build,download,list,update}
build Build image
download Download updates
list List updates
update Update profiles
AutoDMG requires root privileges to execute the OS X installer and will prompt you for your password in order to elevate to root. You can avoid the prompt if you execute AutoDMG with sudo, but be warned that this will execute the whole application as root, not just the image generation. This means that it will store updates in /var/root/Library/Application Support/AutoDMG
, preferences in /var/root/Library/Preferences
, and so on. Unless you're putting AutoDMG in a script or automatic build system you should probably avoid running it with sudo. This also has the benefit of sharing preferences, updates, etc with the GUI.
Makes AutoDMG print more information to stdout.
Set the log level, where 0 is silent and 7 is debug logging. The default 6.
Save the log to a file. You can also use --logfile -
to redirect the log to stdout.
Allow running as root. Normally AutoDMG stops you from running as root, see A note on sudo above.
You can run each subcommand with -h
to see what arguments are supported.
The build command is used to build images. It expects either an OS X installer as the first argument, or a template file.
When a template is used command-line arguments can be used to override options specified in the template.
Set the DMG output path.
Override installer in template.
Set the volume name of the installed system.
Specify system volume size, in GB.
Apply software updates.
Download uncached updates before starting the build.
Overwrite output image even if it exists.
The filesystem to use for 10.13+ images.
List the available software updates from Apple given a version and build such as 10.9.2 13C64
.
Download missing software updates to the cache, expects a version and build such as 10.9.2 13C64
.
Download the latest list of software updates.
Download update profiles from a custom URL.
Fetch the latest update profile (as the logged-in user, see "A note on sudo
", above):
/Applications/AutoDMG.app/Contents/MacOS/AutoDMG update
Download any uncached updates for a specific build of 10.12.4:
/Applications/AutoDMG.app/Contents/MacOS/AutoDMG download 10.12.4 16E195
Dump the full debug log to stdout, download any uncached updates, override the installer source, and build an image using the MySite template:
/Applications/AutoDMG.app/Contents/MacOS/AutoDMG --log-level 7 --logfile - \
build --download-updates --installer /Applications/Install\ OS\ X\ Mavericks.app MySite.adtmpl