Overview
This script is designed to wipe and reinstall MacOS. Currently the fully automated script supports Catalina (10.15) to Monterey (12.0). Please note that the script itself will use the latest version of an OS. This means that if the device is on Big Sur Version 11.2.1 then the script will install with the latest version of Big Sur (11.5). An appropriate amount of disk space is required for this script to work. The amount of free disk space required varies from MacOS version. Currently, Apple recommends 35.5 GB of Free Disk space is recommended for Big Sur. There are also configurations required to successfully deploy this script that will be covered in this article.
How To Use
The script can be ran without any additional configuration on Catalina devices. Any M1 Chip device or any device on Big Sur or newer will require additional authentication from the end user. The following sections will cover each mentioned scenario.
How To Use (11.0 or newer / M1 Chip devices)
As stated above, M1 Chip/Big Sur devices require additional authentication for the script to successfully install. This comes in the form of a username and password of a admin account on the device. To achieve this, one can pass the admin credentials as command line arguments. If no user is passed then the script will use the current logged in user. After downloading the simpleEraseInstall script attached to this article, one can run the script on the devices page with the admin credentials passed for a reinstall of the OS. The following usage for the script is as follows:
sh simpleEraseInstall.sh {admin_password} {admin_user}
An example of command line argument variables:
How To Use (10.15)
Using this script on Catalina is a breeze. One would need to copy the simpleEraseInstall script attached to this article, go to devices page, and create a new script with the pasted contents of the simpleEraseInstall script. After this is setup, you can run this script on any device older than 10.15 for a full reinstall of MacOS. Unlike M1 or Big Sur Devices, you do not need to specify any admin credentials in the command line arguments.