首先需要一台 MacOS
的电脑,无论是白苹果黑苹果,然后下载到 Catalina
的包(可以通过 AppStore
或者更新程序下载到,下载完成之后可以找到 安装macOS Catalina
的一个程序).
准备 BaseSystem.dmg
hdiutil attach /Applications/Install\ macOS\ Catalina.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_esd
hdiutil create -o NewBaseSystem -size 8500m -layout SPUD -fs HFS+J
hdiutil attach NewBaseSystem.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ Catalina.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
rm -rf /Volumes/macOS\ Base\ System/System/Installation/Packages
cp -R /Volumes/install_esd/Packages /Volumes/macOS\ Base\ System/System/Installation
hdiutil detach /Volumes/macOS\ Base\ System/
hdiutil detach /Volumes/install_esd/
mv NewBaseSystem.dmg BaseSystem.dmg
构建最终镜像
hdiutil create -o macOS_10.15_Catalina -size 9800m -layout SPUD -fs HFS+J
hdiutil attach macOS_10.15_Catalina.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ Catalina.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp BaseSystem.dmg /Volumes/macOS\ Base\ System
diskutil rename /Volumes/macOS\ Base\ System/ Install\ macOS\ Catalina
hdiutil detach /Volumes/Install\ macOS\ Catalina/
hdiutil convert macOS_10.15_Catalina.dmg -format UDTO -o macOS_10.15_Catalina