MacOSのインストーラからisoファイルを生成する
端的にはMacOSのインストーラをダウンロードした後に下記を実行(これはMojaveに対するものなのでMojaveと書いてある部分は適宜書き換える必要があるが)
code:bash
$ hdiutil create -o /tmp/Mojave -size 8G -layout SPUD -fs HFS+J -type SPARSE
$ hdiutil attach /tmp/Mojave.sparseimage -noverify -mountpoint /Volumes/install_build
$ sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
$ hdiutil detach /Volumes/Install\ macOS\ Mojave/
$ hdiutil convert /tmp/Mojave.sparseimage -format UDTO -o /tmp/Mojave.iso
$ mv /tmp/Mojave.iso.cdr ~/Desktop/Mojave.iso
$ rm /tmp/Mojave.sparseimage
参考資料
これはHigh Sierraの記事だが、各コマンドの意味合いまで説明されており、良い