Skip to content

3. Downloading a macOS Installer

Graham Pugh edited this page Oct 12, 2023 · 4 revisions

When erase-install.sh is run without any options, it will download the latest available production macOS installer into the /Applications folder.

If an installer is already cached on the system in /Applications, or an installer package is present in the working directory, the script will detect this and do nothing more.

Installer applications in other locations will not be detected.

Note: by default, the working directory is /Library/Management/erase-install. This is where the erase-install.sh script is installed from the package, and where the log files are saved.

Options associated with downloading

--pkg

If the --pkg option is used, the InstallAssistant.pkg is extracted from the downloaded Installer application and stored in the working directory. This option can be useful if you do not want the installer to be cached in /Applications where users will see it.

--fetch-full-installer

If the --fetch-full-installer (or --ffi) option is used, erase-install.sh will use the softwareupdate --fetch-full-installer command to obtain or list installers rather than using mist. The installer will be placed into the /Applications folder.

When using the --fetch-full-installer option. It will set the seed catalog supplied with the --seedprogram argument, using macOS's built in seedutil command. The --fetch-full-installer option can be used in conjunction with the --overwrite, --update, --replace-invalid, --reinstall, and --erase options.

Note: this option may allow the use of a Caching Server, meaning the installer could be obtained more quickly.

--move

If the --move parameter is used, the installer application is subsequently extracted from the InstallAssistant.pkg and placed in the /Applications folder.

--overwrite

If the --overwrite parameter is used, any cached installer, whether in the working directory or in /Applications, is deleted and the latest installer is downloaded from Apple's catalogs.

--update

If the --update parameter is used, and an installer application is already cached on the system, the script will compare the version of the cached system with the installer that is available from Apple's catalogs. If a newer version is available, the cached installer is removed and the latest version is downloaded. Nothing is downloaded if the versions are the same or the cached system is newer (for example there is a cached beta installer).

Note: the --update parameter is ignored if the --overwrite parameter is used.

--replace-invalid

The --replace-invalid parameter works similarly to the --update parameter, but any cached installer is only replaced if the script detects that it is incompatible with the local hardware (usually because the version of the cached installer is older than the current system).

Note: the --replace-invalid parameter is ignored if the --overwrite parameter is used.

--clear-cache-only

The --clear-cache-only parameter can be used in conjunction with --update or --overwrite to facilitate removal of cached installers, so that you do not need to create any sort of clean up script yourself. This option will remove any installers from the local system when used with --overwrite, or any outdated installers when used with --update, and then will exit.

--beta

If the --beta parameter is used, the script will include beta versions in its search.

--catalog XY

By default, Apple's production catalog for the OS that the system is running is used to obtain macOS installer applications. You can specify a different catalog instead by adding the --catalog option and the OS you require, e.g. --catalog 13 to use the catalog normally used on macOS 13.

--seedprogram PROGRAM_TYPE

By default, Apple's production catalog is used to obtain macOS installer applications. However, you can access installers from one of Apple's seed programs. The available seed programs are PublicSeed, CustomerSeed and DeveloperSeed. These correspond to the Public Beta, AppleSeed and Developer catalogs.

Options to filter a specific installer

The Apple catalogs maintain multiple versions of the macOS installer. erase-install.sh can download any that is available. By default it will download the latest version available that is compatible with the hardware on which the script is being run.

If you wish to obtain a different installer, you can use one of the options below.

--samebuild

Run the script with argument --samebuild to obtain the installer which matches the current system macOS build (using sw_vers), rather than the latest production installer available.

This allows the reinstallation of a forked or beta version that is already installed on the system volume, so long as that version is still available in the catalog.

--sameos

Run the script with argument --sameos to obtain the installer which matches the currently installed macOS major version, for example 10.15, 11 etc. This basically filters by major version, and looks for the latest build matching the currently installed major version.

This is useful if you want to avoid upgrading during an erase-install workflow, but don't want to have to specify a particular OS.

--os MAJOR_VERSION

Run the script with argument --os=MAJOR_VERSION or --os MAJOR_VERSION to check for the installer which matches the specified macOS major version. This basically filters by major version, and looks for the latest build matching the currently installed major version.

For example, sudo bash erase-install.sh --os=11 will obtain the latest version of macOS 11 available in the catalog, so long as it is compatible with the system on which the script is being run.

Important: You can only specify an OS Version with the OS parameter. To specify a point release version, e.g. 11.4, use the --version parameter instead.

--version VERSION

Run the script with argument --version=VERSION or --version VERSION (example 10.14.3, 11.3) to check for the installer which matches the specified macOS minor version. This basically filters by version, and looks for the highest build matching the version.

--build BUILD_ID

Run the script with argument --build=BUILD_ID or --build BUILD_ID (example 19A123) to check for the installer which matches the specified build ID, rather than the latest production installer or the same build.

Note that this will only work if the build is compatible with the device on which you are running the script.

--dialog-on-download

A notification message is not normally displayed during the download process unless the workflow also includes --reinstall or --erase. However, you can make the download dialog appear with the --dialog-on-download argument. The dialog will close once the download is complete.

download