制作MacOS镜像

1、获取App格式的macOS完整镜像

官网地址:https://support.apple.com/zh-cn/HT211683

Catalina:https://apps.apple.com/cn/app/macos-catalina/id1466841314?mt=12

Monterey:

Big Sur

Ventura

image-20221203010218270

2、创建一个大小比app镜像大500M的空白dmg镜像

保存位置在桌面上:

Moterey:

1
hdiutil create -o~/Desktop/macOS\ Monterey -size 14.6GB -layout SPUD -fs HFS+J

Big Sur:

1
hdiutil create -o~/Desktop/macOS\ Big\ Sur -size 14.6GB -layout SPUD -fs HFS+J

Catalina:

1
hdiutil create -o ~/Desktop/macOS\ Catalina -size 10GB -layout SPUD -fs HFS+J

Mojave:

1
hdiutil create -o ~/Desktop/macOS\ Mojave -size 7GB -layout SPUD -fs HFS+J

High Sierra:

1
hdiutil create -0~/Desktop/macOS\ High\ Sierra -size 6GB -layout SPUD -fs HFS+J

Sierra:

1
hdiutil create -o~/Desktop/macOS\ Sierra -size 6GB -layout SPUD -fs HES+J

image-20221203011823414

3、挂载创建的dmg镜像到虚拟磁盘

1
2
3
4
5
6
7
8
9
10
11
hdiutil attach ~/Desktop/macOs\ Monterey.dmg -noverify -mountpoint /Volumes/macOs\ Monterey

hdiutil attach ~/Desktop/macOS\ Bigl Sur.dmg -noverify -mountpoint /Volumes/macOS\ Big\ Sur

hdiutil attach ~/Desktop/macOsl Catalina.dmg -noverify -mountpoint /olumes/macOS\ Catalina

hdiutil attach ~/Desktop/macOSl Mojave.dmg -noverify -mountpoint /olumes/macOS\ Mojave

hdiutil attach ~/Desktop/macOSl High\ Sierra.dmg -noverify -mountpoint /Volumes/macOS\ Highl\ Sierra

hdiutil attach ~/Desktop/macOsl Sierra.dmg -noverify -mountpoint /Volumes/macoS\ Sierra

4、把app镜像写入到创建的dmg磁盘文件

Ventura:

1
sudo /Applications/Install\ macOS\ Ventura.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Moterey:

1
sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Big Sur:

1
sudo /Applications/Install\ macOS\ Big\ Sur.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Catalina:

1
sudo /Applications/Install\ macOS\ Catalina.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

Mojave:

1
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

High Sierra:

1
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume

EI Capitan:

1
sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/MyVolume --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app

image-20221203011109586

5、卸载挂载的dmg磁盘

1
2
3
4
5
6
7
8
9
10
11
hdiutil detach /Volumes/Install\ macoS\ Monterey

hdiutil detach /Volumes/Install\ macOs\ Big\ Sur

hdiutil detach /Volumes/Install\ macOS\ Catalina

hdiutil detach /Volumes/Install\ macos\ Mojave

hdiutil detach /Volumes/Install\ macos\ High\ Sierra

hdiutil detach /Volumes/Install\ macOS\ Sierra

6、将dmg镜像转换为cdr镜像

1
2
3
4
5
6
7
8
9
hdiutil convert ~/Desktop/macOS\ Monterey.dmg-format UDTO -o ~/Desktop/macOs\ Monterey

hdiutil convert ~/Desktop/macOS\ Big\ Sur.dmg -format UDTO -o ~/Desktop/macOS\ Big\ Sur

hdiutil convert ~/Desktop/macOS\ Catalina.dmg -format UDTO -o ~/Desktop/macOS\ Catalina

hdiutil convert ~/Desktop/macOS\ Mojave.dmg -format UDTO -o ~/Desktop/macOS\ Mojave

hdiutil convert ~/Desktop/macOS\ High\ Sierra.dmg -format UDTO -o ~/Desktop/macOS\ High\ Sierra

image-20221203011421943

7、将cdr格式镜像改成iso镜像