# Run Xcode from Windows Using a Remote Mac

Canonical: https://figment.so/blog/mac-xcode-on-windows-remote-setup

Xcode only runs on macOS, so rent a Mac and reach it from Windows over SSH. Generate an ED25519 key in PowerShell, add a named host block, then run xcodebuild remotely. Use remote desktop for the GUI.

**Apple does not ship Xcode for Windows, so run Xcode on a real Mac and reach it from your Windows machine over SSH or remote desktop.** The steps below generate an ED25519 key in Windows Terminal, write a reusable `~/.ssh/config` block, and end with your first successful `xcodebuild` from PowerShell.

## Why does Xcode have no Windows installer?

Xcode links directly into macOS frameworks: Security, CoreFoundation, the iOS Simulator process, and the Clang/LLVM toolchain bundled with the macOS SDKs. None of those ship for Windows. Apple's software license also ties macOS to Apple hardware, so a Windows VM running macOS is not a supported path. The only supported setup is Xcode on macOS, reached remotely.

Your Xcode version drives your hardware choice. Apple's porting guide tells developers who still need Intel support to [use Xcode 26 or earlier on Intel-based processors](https://developer.apple.com/documentation/apple-silicon/porting-your-macos-apps-to-apple-silicon). Check your exact pair in the [Xcode release notes](https://developer.apple.com/documentation/xcode-release-notes) before you rent, because different Xcode point releases ship with different minimum macOS versions.

## How do I generate an ED25519 key on Windows?

Windows 10 and later include an OpenSSH client. If `ssh-keygen` is missing, enable it at **Settings → Apps → Optional features → Add a feature → OpenSSH Client**. In Windows Terminal (PowerShell):

```powershell
# Generate the key; accept the default path and set a passphrase when prompted
ssh-keygen -t ed25519 -C "windows-build-$env:COMPUTERNAME"

# Put the public key on the clipboard
Get-Content "$env:USERPROFILE\.ssh\id_ed25519.pub" | Set-Clipboard
```

Once your Mac is provisioned, make one connection with your initial credentials to install the public key:

```powershell
# Replace macuser and <mac-host> with the values for your Mac
ssh macuser@<mac-host> "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"
# Paste the public key line, press Enter, then Ctrl+Z then Enter to end stdin
```

If your Windows OpenSSH build includes it, `ssh-copy-id macuser@<mac-host>` does the same thing in one step.

## How do I write a reusable SSH config block?

Open `C:\Users\<YourName>\.ssh\config` in any editor and add:

```
Host figment-mac
    HostName <mac-host-or-ip>
    User macuser
    IdentityFile ~/.ssh/id_ed25519
    ServerAliveInterval 60
    ServerAliveCountMax 5
    AddKeysToAgent yes
```

Test it with `ssh figment-mac`. You should land at the macOS shell without a password prompt. From there, `ssh figment-mac <command>` runs any one-liner non-interactively, which the checklist below depends on.

## How do I check the toolchain before building?

Run one command to print the installed Xcode version and the active SDK:

```bash
ssh figment-mac 'xcodebuild -version && xcrun --show-sdk-path'
```

If `xcodebuild` prints "command not found", Xcode.app itself is not installed yet. Open the Mac's desktop in a remote desktop session, install Xcode from the App Store or run `xcode-select --install` for command-line tools only, then run the check again.

## How do I get the Xcode GUI from Windows?

Open the encrypted remote desktop that comes with your plan. Reach for it when you need Interface Builder, Instruments or a storyboard preview. For scripted builds, unit tests and simulator CLI runs, SSH alone has lower latency and is scriptable.

If you would rather use your own VNC client, enable macOS Screen Sharing under **System Settings → General → Sharing → Screen Sharing**, and reach it only through an SSH tunnel, never directly on port 5900:

```powershell
ssh -N -L 5901:localhost:5900 figment-mac
# Point your VNC client at localhost:5901
```

## What is the 10-step checklist for my first remote build?

Substitute your own repo, scheme and simulator name. The `set -euo pipefail` prefix makes a failed build return a non-zero exit code to your Windows shell instead of being silently tailed as success.

```
[ ]  1. Enable OpenSSH Client in Windows optional features
[ ]  2. Open Windows Terminal (PowerShell)
[ ]  3. ssh-keygen -t ed25519 -C "windows-build-$env:COMPUTERNAME"
[ ]  4. Get-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard
[ ]  5. One initial SSH login; append the public key to ~/.ssh/authorized_keys
[ ]  6. Add the Host figment-mac block to C:\Users\<Name>\.ssh\config
[ ]  7. ssh figment-mac   (passwordless login works)
[ ]  8. ssh figment-mac 'xcodebuild -version && xcrun --show-sdk-path'
[ ]  9. ssh figment-mac 'git clone <your-repo-url> ~/MyProject'
[ ] 10. First build (adapt scheme and destination to your project):
         ssh figment-mac 'set -euo pipefail; cd ~/MyProject && \
           xcodebuild -scheme <YourScheme> \
           -destination "platform=iOS Simulator,name=iPhone 16" \
           -configuration Debug build'
```

Treat the `xcodebuild` line as an untested example. The scheme name and the available simulator runtime depend on your project and the installed Xcode on the rented Mac. Confirm both with `xcodebuild -list` and `xcrun simctl list devices` before you wire the command into a CI job.

## Which Figment Mac plan fits a Windows workflow?

Every Figment plan includes browser access and SSH, so Windows works with all three. The Intel Mac VM and the Dedicated M4 Pro also include encrypted remote desktop.

| Your toolchain | Figment plan | Price |
|---|---|---|
| Xcode 26.3 or earlier, command-line builds, outbound CI agents (macOS Sequoia) | [Intel Mac VM](/mac-hosting#intel-vm) | $25 a month, $2 a day |
| Xcode 26.4 or later, Xcode 27, arm64-only tools, visionOS | [Apple Silicon Mac VM](/mac-hosting#apple-silicon-vm) | $39 a month, $6 a day |
| Heavy GUI or Simulator work, a whole Mac | [Dedicated M4 Pro 48 GB](/mac-hosting#dedicated-m4-pro) | $349 a month ($299 on a 12-month term) |

We have not measured Instruments or GPU-heavy simulators inside a VM, so test your project in the first days of a month on the Dedicated M4 Pro 48 GB; you can cancel month to month at any time. Compare the macOS version shown before purchase with Apple's Xcode requirements table.

For reference, [CloudMac](https://cloudmac.org/pricing) lists an M4/16 GB/256 GB Mac at $99.99/month, and [its homepage](https://cloudmac.org/) lists a $999/year reservation on the same hardware ($83.25 effective monthly). That annual rate is lower than twelve months of the Dedicated M4 Pro 48 GB ($3,228 paid up front) and higher than twelve months of the Apple Silicon Mac VM (12 × $39 = $468), which has shared vCPUs and 4GB RAM. [MacStadium's pricing page](https://macstadium.com/pricing) publishes M2.S at $109, M4.S at $149 and M4.M at $249 with 99.99% uptime and support included. See all [Mac hosting plans](/mac-hosting).

---

**Related guides:**
- [Connect VS Code Tunnel to a Remote Mac for Swift](/blog/mac-vscode-tunnel-swift-remote)
- [Debug iOS Apps Remotely with LLDB on a Rented Mac](/blog/mac-lldb-remote-debug-xcode)
- [Set Up a GitHub Actions Self-Hosted Runner on a Mac](/blog/mac-github-actions-self-hosted-runner)
