Last updated on 13. October 2022
Wipe and install the latest macOS system in 20 minutes
Tested on macOS Catalina, macOS Big Sur and macOS Monterey.
In the last few weeks I had to install macOS several times and delete my test devices again.
To prevent the 12 GB download every time i cached the installer on an external disk.
After only a few days I realised that the installer is already outdated again and that this idea requires a lot of effort, especially if you have prepared several cache disks.
Therefore I decided to solve the problem on the server side, only to discover that the server-side cache of 12 GB is not particularly practical, especially in the mobile office.
The result is that I have opted for a combined solution with a server side script.
sudo bash < <( curl -sL wipe.it-profs.de)
- Check if the user is authorised for the installation.
- Check if a cache disk exist named “macOSCache”
- Check free disk space.
- Use the installer from the cache disk if exists.
- After installation the Install macOS Monterey.app i check the version.
- I compare the latest server version with the local version .
- Save installer on cache disk if the disk exists.
- Ask for update the cached installer if it exists.
This script will also work with the new Apple Silicon ARM64 (M1) generation but there is a limitation in recovery mode. Currently, the eraseinstall command does not work in option mode, so only the installer is loaded and you have to start the installation manually. But this also saves you an enormous amount of time. (I recommend to use the new built-in erase functions in system preferences if you have access to the system)
In this script, two additional parameters are retrieved. For this purpose I have built a small service that provides me with the current URL for the InstallAssitant.pkg and the InstallInfo.plist. You can also build this service yourself/statically.
The source code of the script is also in my GitHub repo https://github.com/macBerlin/macOS_erase/blob/main/macOS_erase
The published information has been carefully compiled, but does not claim to be up-to-date, complete or correct. No liability is assumed for damages resulting from the use of this script or the information drawn from it. This also applies to third-party content accessible via this offer.
thanks a lot for sharing this, it is really helpful. Would you mind sharing latest.php as well? For our workflow, we cannot depend on your site.
the latest.php is just a small handler and it is based on the project
I’ve been using this way of wiping Macs for that last few months and it has saved me sooooo much time it’s amazing 🙂
One thing though, for some reason it now always comes back with:
[WARNING]: This script must be run as root. Try the sudo command.
Is this a Big Sur 11.5.2 thing? (that’s the macOS I’m on at the moment, haven’t tested previous versions just yet).
Crossing my fingers that it’s an easy fix, or maybe it’s just me 🙁
Thanks for this amazing script!
One comment, your first line in this page is: “Wipe and reinstall your macOS system in 20 minutes”.
A suggestion, to fight any confusion here would be to re-word it to: “Wipe and install the latest macOS system in 20 minutes”
In sort of relation to that, would you consider exploring the option to choose Major version of mac as a switch? for example, we are still running Big Sur here until we can approve Monterey with our build. It would be super awesome if you could add a switch at the end of your command somewhere like “–Catalina” or “–BigSur” in order to be able to wipe and reinstall other versions of MacOS 🙂
Just an idea.
Hey Vincent, thanks for the feedback!
I will have a look on this how can i implement this feature.
thanks for the script, great work! Related to your LinkedIn post (6 hours Monterey upgrade) I am just wondering, how do you reinstall brand new MacBooks, pre-installed with Big Sur, with Monterey without enrolling them first. Did I miss something?
Hello Philipp, this is the trick a start from option/recovery mode and can run this script from Terminal.