Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save enXov/9a462245a4af8a6792558cc821f34d81 to your computer and use it in GitHub Desktop.

Select an option

Save enXov/9a462245a4af8a6792558cc821f34d81 to your computer and use it in GitHub Desktop.

To test your apps, you might want to install Xcode and the iPhone simulator. This is entirely possible using a macOS virtual machine. Today, I will explain how to do this using dockur/macos. First, download and install it by following the instructions in their README file. After the installation is complete, macOS will show a warning in the top right corner to upgrade to the 'Tahoe' version. Click it and upgrade to the latest macOS. Then, open your terminal at the bottom right (I'm mentioning this for first-time Mac users xd). Once opened, enter these commands in order:

# Install Brew (see: https://brew.sh):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

brew install xcodes

xcodes is actually a tool used to manage multiple Xcode versions, but we are intentionally using it here to automate the installation and because Apple can sometimes cause trouble when running macOS via a VM. This is a 100% guaranteed method. I have explained this using the latest macOS version (Tahoe), but you can install whichever Xcode version supports your specific macOS version. You can check xcodereleases.com for compatibility. After finding the Xcode version that suits you, open Safari (bottom left on the taskbar) and go to https://developer.apple.com/download/all/. Once logged in, scroll down to find Xcode 26.2, click View Details, and download Xcode_26.2_Universal.xip. We are downloading from here because the Universal version works on macOS VMs. If we were to download Xcode directly via the xcodes CLI, it might not work because those versions are often optimized for Apple Silicon (M1, M2, M3), whereas VMs generally use the Intel architecture. The Universal version ensures compatibility with Intel.

After the download is finished, open the terminal and type: xcodes install 26.2 --path ~/Downloads/Xcode_26.2_Universal.xip. We use the xcodes command here to automate the process, such as automatically moving the app to the Applications folder. Xcodes will ask for your Apple ID and password. You can create one for free here: Apple Support. Enter your credentials when prompted. We intentionally avoid logging in through the macOS System Settings because errors and bugs frequently appear there; this remains the most reliable way. Now that Xcode is installed, happy coding!

SIMULATOR ONLY:

After installing and opening Xcode, click the Xcode menu in the top left > Settings > Components, and install the simulator you want. Once the desired emulator is installed, go to the Xcode menu again > Open Developer Tool > Simulator. Have a nice time coding and testing!!!111!!!???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment