下載虛擬機和MacOS就不說了,網上很多教程。這裏需要設置的2個方面
1.VirtualBox中設置MacOS屬性
cd到VirtualBox的安裝目錄
將一下目錄依次輸入
VBoxManage modifyvm "Mac" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "Mac" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "Mac" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "Mac" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "Mac" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "Mac" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
說明:其中的“Mac”是你自己自定創建的虛擬Mac名稱,我的名稱就叫Mac。
設置屏幕分辯率
當你把Mac安裝好一會就回遇到屏幕適配不兼容的問題,要調整分辨率
同樣cd到VirtualBox的安裝目錄依次輸入一下命令
VBoxManage setextradata "Mac" CustomVideoMode1 1900x950x32
VBoxManage setextradata "Mac" VBoxInternal2/EfiGraphicsResolution 1900x950
說明:1900x950是我自己設置的屏幕分辯率,這個可以根據自己的需要指定,後面的x32爲顏色格式。這樣就可以愉快的使用Mac擼代碼了。嘻嘻!