I. Make Installation media

1. Download OS media from App Store

2. Prepare a spare 8G+ USB disk

3. Format the USB disk

Format it with Disk Utility, name it as Mojave in Mac OS Ext(Logging) format

4. Write the OS media into USB disk

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

II. Install MacOS

1. Reboot, press down Option key

2. Select Install macOS Mojave

a. set the system time to an older date

date '032208102015.20'  # 2015-03-22 08:10:20

b. turn off LAN WiFi to avoid time auto reset

III. Post Setup

1. Add some alias

vi .bash_profile
alias ll='ls -l'
set -o vi

2. Install VMWare Fusion

After installation, adjust the vmnet8 net segment

cd /Library/Preferences/VMware\ Fusion/
sed -i 's/172.16.168/192.168.157/' *
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --configure
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start

3. Remove password length requirement

pwpolicy -clearaccountpolicies

4. Add a shortcut for VSCode

自动操作 > 快速操作,
实用工具 > 运行Shell脚本
服务收到的文件夹,位于访达
运行Shell脚本:

for f in "$@"
do
    open -a "Visual Studio Code" "$f"
done