When I develop the iOS application, I need a mac computer. But as you know, the mac computer is too expensive, so I have an idea to install the macOS on VirtualBox virtual machine, and then I can develop the iOS app on that virtual machine.
At first, I download the newest macOS Mojave following the article How To Download macOS Mojave Installer And Convert To ISO File, and when I have done creating the iso file, I find VirtualBox does not support macOS Mojave, the highest version that Virtualbox supports is macOS High Sierra. So I need to download the macOS High Sierra.
1. How To Download macOS High Sierra.
- After searching the sentence macOS High Sierra download in google, I finally find the macOS high sierra download link. Click it will open the App Store in your current macOS ( my current os is Mojave ). And it will show the macOS High Sierra download page.
- Click the blue GET button to popup the download macOS High Sierra prompt dialog, it will ask you whether to download it now or later, click the Download button to start the download.
- During the download process, you can see the remaining time of the download.
- When the download completes, the macOS High Sierra installer file will be saved in the/Applications folder, the installer file name is Install macOS High Sierra.
- You can also find it in the terminal using the below command.
$ cd /Applications/ $ ls -l Install\ macOS* Install macOS High Sierra.app: total 0 .drwxr-xr-x 11 root wheel 352 Dec 14 19:03 Contents Install macOS Mojave.app: total 0 .drwxr-xr-x 11 root wheel 352 Dec 14 19:03 Contents
2. Create ISO File From macOS High Sierra Installer.
- Now it is time to convert the above macOS high sierra installer to an iso file to install it in VirtualBox.
- You can follow below brief steps to do it. If you want to see detail explain, you can read the article How To Download macOS Mojave Installer And Convert To ISO File.
- Create a temporary dmg file which will be used to save macOS high sierra content.
$ hdiutil create -o /tmp/high-sierra.cdr -size 7316m -layout SPUD -fs HFS+J created: /tmp/high-sierra.cdr.dmg
- Attach the above dmg file to install_build volume.
hdiutil attach /tmp/high-sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build /dev/disk3 Apple_partition_scheme /dev/disk3s1 Apple_partition_map /dev/disk3s2 Apple_HFS /Volumes/install_build
- Restore downloaded macOS high sierra installer to install_build volume.
$ asr restore -source /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase Validating target...done Validating source...done Retrieving scan information...done Validating sizes...done Restoring ....10....20....30....40....50....60....70....80....90....100 Restored target device is /dev/disk3s2. Remounting target volume...done
- Now go to /Volumes directory, you can see there are two volumes, the main disk volume is used for current macOS, and the other is for macOS high sierra installer.
$ cd /Volumes/ Main Disk/ OS X Base System/
- Detach above OS X Base System/ volume.
$ hdiutil detach /Volumes/OS\ X\ Base\ System "disk3" ejected.
- Convert the temp dmg file to the iso file.
$ hdiutil convert /tmp/high-sierra.cdr.dmg -format UDTO -o /tmp/high-sierra.iso Reading Driver Descriptor Map (DDM : 0)… Reading Apple (Apple_partition_map : 1)… Reading disk image (Apple_HFS: 2)… .................................................................................................................................................................................. Elapsed Time: 33.138s Speed: 220.8Mbytes/sec Savings: 0.0% created: /tmp/high-sierra.iso.cdr
- Move the iso file to the desktop.
$ mv /tmp/high-sierra.iso.cdr ~/Desktop/high-sierra.iso
3. Example Demo Video.
- You can see this example demo video on the URL https://youtu.be/GV-8VNKySPs.