Skip to content

Instantly share code, notes, and snippets.

@julianxhokaxhiu
Last active June 18, 2023 08:11
Show Gist options
  • Save julianxhokaxhiu/d26a8974eb0d723285c6b06c99d7207e to your computer and use it in GitHub Desktop.
Save julianxhokaxhiu/d26a8974eb0d723285c6b06c99d7207e to your computer and use it in GitHub Desktop.
Simple bash script to create a Bootable ISO from macOS Monterey Install Image from Mac App Store
#!/usr/bin/env bash
#===========================================================================
# Works only with the official image available in the Mac App Store.
# Make sure you download the official installer before running this script.
#===========================================================================
# Change this at your desire. Sometimes this works out of the box, sometimes not.
# Default size: ~16 GB
DISK_SIZE="15361m"
#===========================================================================
hdiutil create -o /tmp/Monterey.cdr -size $DISK_SIZE -layout SPUD -fs HFS+J
hdiutil attach /tmp/Monterey.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo "/Applications/Install macOS Monterey.app/Contents/Resources/createinstallmedia" --volume /Volumes/install_build --nointeraction
hdiutil detach "/Volumes/Shared Support"
hdiutil detach "/Volumes/Install macOS Monterey"
hdiutil convert /tmp/Monterey.cdr.dmg -format UDTO -o /tmp/Monterey.iso
mv /tmp/Monterey.iso.cdr ~/Desktop/Monterey.iso
rm /tmp/Monterey.cdr.dmg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment