Create macOS ISO

By | October 19, 2017
1) Create a blank disk image:
hdiutil create -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS+J
2) Mount your image:
hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
3) Restore BaseSystem.dmg from the installer:
asr restore -source /Applications/Install\ macOS\ High\ -target /Volumes/install_build -noprompt -noverify -erase
4) Unmount the image:
hdiutil detach /Volumes/OS\ X\ Base\ System
5) Convert the image you created into an ISO file:
hdiutil convert /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso
6) Move the ISO to the desktop:
mv /tmp/HighSierra.iso.cdr ~/Desktop/HighSierra.iso