This wikiHow teaches you how to install Xcode on a Mac or Windows PC running VirtualBox.
Step
Method 1 of 2: On Windows 10, 8.1, and 7
Step 1. Download and install the VirtualBox for Windows program
This program is a free, open source hypervisor that allows you to run multiple virtual machines, including Xcode for MacOS.
-
Visit https://www.virtualbox.org/wiki/Downloads and click " Windows hosts " The file will download immediately afterwards (you may need to click the “ Save " or " Download " to continue).
The computer must be running a 64-bit version of Windows with at least 4 GB of RAM
- Run the installation file, then follow the on-screen instructions to complete the process.
Step 2. Download macOS High Sierra Final
You can download the free RAR version here.
If you can't download it because the file size is too large (6 GB), you can find a fix or workaround here
Step 3. Extract the downloaded RAR file
You can use an extractor application that supports the RAR format such as WinRAR or WinZip. Once the files are extracted, you will have a folder containing the High Sierra “.vmdk” file and the “.txt” extension.
Step 4. Open VirtualBox
You can find it in the “ All Apps ” in the “Start” menu.
Step 5. Click New
It's in the upper-left corner of the app window. The “Create Virtual Machine” dialog box will load afterwards.
Step 6. Type OSX into the “Name” field
Step 7. Select Mac OS X from the “Type” drop-down menu
Step 8. Choose macOS 10.13 High Sierra (64-bit) or MacOS 64-Bit from the “Version” drop-down menu.
If you don't see the 64 bit option, enable “VT-x” or virtualization (“virtualization”) in the BIOS settings. Read this article to find out how to access the BIOS
Step 9. Click Next
It's at the bottom of the window.
Step 10. Drag the slider to the desired memory size
This slider determines how much hard drive space you will allocate for High Sierra. It's a good idea to use 3-6 GB.
Step 11. Click Next
Step 12. Create a hard drive
Follow these steps to create one:
- Click the button next to “Use an existing virtual hard disk drive”.
- Click the search icon.
- Locate the previously extracted High Sierra “.vmdk” file.
- Select the file and click " Create ”.
Step 13. Click Settings
It's in the upper-left corner of the window.
Step 14. Edit the virtual machine
Make the following updates to the machine settings:
-
Click System ” in the left column.
- On the motherboard tab, select “ ICH9 ” from the “Chipset” menu, then check the box next to “ Enable EFI ”.
-
On the tab " Processor ", choose"
Step 2.” as the processor number, then slide the “Execution cap” slider to the number “ 70% ”.
-
Click Display ” in the left column.
On the tab " Screen ", choose " 128 MB ” as “Video Memory” value.
- Click " OK ” to save changes.
Step 15. Close VirtualBox
You can close the program by clicking the X ” in the upper right corner of the application window.
Step 16. Open a multilevel Command Prompt window on the PC
Follow these steps to open it:
- Type cmd into the search field on the taskbar.
- Right click " Command Prompt ” in the search results.
- Click " Run as administrator " A black window with a command line will be displayed.
Step 17. Run the following commands via Command Prompt
Execute the commands sequentially, but replace the directory address with the VirtualBox location, and “VM Name” with the virtual machine name:
- Type cd "C:\Program Files\Oracle\VirtualBox\" and press Enter.
- Type in VBoxManage.exe modifyvm "VM Name" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff and press Enter.
- Type in VBoxManage setextradata "VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11, 3" and press Enter.
- Type in VBoxManage setextradata "VM Name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" and press Enter.
- Type in VBoxManage setextradata "VM Name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" and press Enter.
- Type in VBoxManage setextradata "VM Name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" and press Enter.
- Type in VBoxManage setextradata "VM Name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 and press Enter.
Step 18. Reopen VirtualBox
You can also close the Command Prompt window if you want.
Step 19. Click Start
It's a green arrow icon in the upper-left corner of the app window.
Step 20. Set up your virtual Mac computer
Follow the on-screen instructions to set up High Sierra, just like when you set up a new computer. After that, sign in to your Apple ID when prompted. When finished, the virtual Mac will display the home screen.
Step 21. Open the App Store
It's in the Dock at the bottom of the screen.
Step 22. Search for Xcode
Type xcode into the search bar in the upper-right corner of the App Store window and press Enter.
Step 23. Click Xcode
This option is the first search result. Look for the blue App Store icon with the hammer.
Step 24. Click Get
If you weren't signed in to your Apple ID during the initial setup process, you'll need to sign in to your ID at this stage.
Step 25. Click Install
Xcode will be installed to the virtual Mac. Once done, the “Open” button will be displayed.
Step 26. Click Open to run Xcode
Step 27. Click Agree
It's in the lower-right corner of the license agreement pop-up window.
Step 28. Enter the Mac administrator password to continue
Xcode will install some additional features afterwards.
Step 29. Start a new project
- If this is your first time using Xcode, select “ Get started with a playground ” to do the coding in the built-in “template” or environment.
- To start the project from scratch, click “ Create a new Xcode project ”.
- If you are prompted to enable developer mode on a Mac, click “ OK ”.
Method 2 of 2: On MacOS
Step 1. Open the App Store
The App Store icon is in the Dock, which is usually shown at the bottom of the screen.
Step 2. Type xcode into the search bar and press Return
A list of matching search results will be displayed.
Step 3. Click Xcode
This option is the first search result. Look for the blue App Store icon with the hammer.
Step 4. Click Get
Step 5. Click Install
Xcode will be downloaded and installed to the computer. After installation is complete, the “Install” button will change to an “Open” button.
Step 6. Click Open
Xcode will run after that.
Step 7. Click Agree
It's in the lower-right corner of the license agreement pop-up window.
Step 8. Enter the administrator password
Xcode will install additional components to the computer.
Step 9. Start a new project
- If this is your first time using Xcode, select “ Get started with a playground ” to do the coding in the built-in “template” or environment.
- To start the project from scratch, click “ Create a new Xcode project ”.
- If you are prompted to enable developer mode on a Mac, click “ OK ”.