iOS Apps Without a Mac: A Linux Cloud VM, a Windows Mini-PC, and a USB Cable Stretched Over Tailscale


iOS Apps Without a Mac

Every “how to make an iPhone app” guide starts the same way: buy a Mac. This build log is about refusing to do that.

The goal: write Swift, build a real iOS app, sign it, and install it on a physical iPhone, using zero Apple computers. The weapon of choice is xtool, a cross-platform tool that builds SwiftPM packages into signed iOS apps from Linux or Windows. The problem: xtool needs a USB connection to the phone, and our Linux build machine is a free-tier Oracle Cloud VM in Montreal. The iPhone is plugged into a Windows mini-PC in Winnipeg. Those two facts are about 1,900 km apart.

The fix is to stretch the USB cable across the internet: usbip over Tailscale. The mini-PC shares its USB port, the VM attaches the phone as a virtual USB device, and as far as Linux is concerned, the phone is plugged straight in.

Spoiler: as of this morning, the VM in Montreal can read the UDID of an iPhone 6s sitting in Winnipeg. The pipe is live. Here’s the whole build, including every wall we ran into.

[THE_SETUP]

Three machines, three jobs:

  • The dock (Winnipeg): a Windows mini-PC (Ryzen 7 PRO mini box) with the iPhone plugged into it. Its only job is to share that USB port. It runs usbipd-win, the Windows USB/IP server.
  • The builder (Montreal): an Oracle Always Free VM (ARM, 4 cores, 24 GB RAM, Ubuntu 24.04). It runs the Swift toolchain, xtool, and the Linux USB/IP client that attaches the phone.
  • The pipe: Tailscale connects both machines on a private network, so the USB traffic rides the tailnet. No port forwarding, no public exposure of the USB server.

On the builder you’ll also want usbmuxd and libimobiledevice (ideviceinfo, idevicepair) — that’s the stack that actually talks to iPhones over USB once the device shows up.

[PHASE_1_THE_TOOLCHAIN]

xtool needs a real Swift toolchain. On Ubuntu 24.04 (ARM64 here, x86_64 works too):

  1. Install Swift 6.4.1. Learn from our pain: the download tag includes the patch version. swift-6.4-RELEASE 404s; the working URL shape is:
https://download.swift.org/swift-6.4.1-release/ubuntu2404-aarch64/swift-6.4.1-RELEASE/swift-6.4.1-RELEASE-ubuntu24.04-aarch64.tar.gz

(Omit the -aarch64 parts on Intel.) The ground truth for current URLs is https://www.swift.org/api/v1/install/releases.json.

  1. Skip Swiftly on cloud VMs. Swiftly’s installer failed repeatedly on our VM (its HTTP client couldn’t reach the release list while plain curl to the same hosts worked fine). The direct tarball via curl worked first try. Extract it, put usr/bin on your PATH, swift --version to confirm.

  2. Install xtool (1.24.0 at time of writing) from its GitHub releases, and make sure usbmuxd is installed and running.

  3. The one download only a human can do: xtool setup needs the iOS SDK, which it extracts from an Xcode .xip — and that file can only be downloaded from Apple’s developer site while signed in with an Apple ID. Grab the Xcode 27 .xip in a browser, get it onto the VM, and run xtool setup. Good news for anyone hoarding old hardware: the current Xcode targets iOS 15 and up, so even an iPhone 6s on iOS 15.8 is a valid build target.

Signing reality check: with a free Apple ID, xtool can sign and install apps that expire after 7 days (max 3 at a time). The $99/yr Developer Program gets you 1-year signing, TestFlight, and App Store submission. xtool itself does not submit to the App Store — that’s still a separate step later.

[PHASE_2_THE_USB_PIPE]

On the Windows dock (PowerShell as Administrator):

winget install --exact --id dorssel.usbipd-win --accept-package-agreements --accept-source-agreements
usbipd list
usbipd bind --busid <the Apple device's busid>

Note the busid of the “Apple Mobile Device USB Composite Device” line from the list (ours was 4-1). Then, on the Linux builder:

sudo modprobe vhci-hcd
usbip list -r <dock's Tailscale IP>
sudo usbip attach -r <dock's Tailscale IP> -b 4-1
lsusb

If lsusb shows an Apple device (05ac:12a8), the cable now spans two provinces. Restart the muxer once so it notices the new hardware, then ask the phone who it is:

sudo systemctl restart usbmuxd
idevice_id -l
ideviceinfo

[THE_WAR_STORIES]

No build log is honest without the walls. We hit four:

1. UAC does not care about your automation. Installing usbipd-win needs elevation, and the UAC consent prompt lives on Windows’ Secure Desktop — a separate desktop that no script, agent, or pyautogui click can reach. That’s by design: if software in your session could click “Yes,” UAC would be decorative. We had an agent download and stage the entire install remotely; the last step was still a human finger on a mouse. Budget one physical click.

2. The ghost of installs past. Approving a UAC prompt for a backgrounded installer doesn’t guarantee the install completes. Verify C:\Program Files\usbipd-win\usbipd.exe actually exists and the service is present before debugging anything downstream — and remember that shells opened before an install have a stale PATH, so “usbipd is not recognized” often just means “open a new terminal.”

3. Force-bind can scramble the device. A plain bind exported our iPhone in an “error state” on attach. The fix was usbipd bind --force --busid 4-1, but the driver swap briefly turned the phone into “Unknown USB Device (Device Descriptor Request Failed).” Recovery: remove the ghost devices with pnputil /remove-device, clean the stale usbipd entries, unplug the phone for a full 30 seconds, and replug. It came back clean — and because the bind persists by device GUID, it came back already shared.

4. The phone has trust issues (correctly). To the iPhone, the VM is a brand-new computer. idevicepair pair fails while the phone is locked (“a passcode is set”), so unlock it, run the pair command, and tap Trust This Computer on the phone. That pairing record lives on the VM now, so it’s a one-time ceremony.

[WHERE_IT_STANDS]

Verified working, end to end: iPhone 6s plugged into a mini-PC in Winnipeg → usbipd-win → Tailscale → attached on an Oracle VM in Montreal → lsusb and idevice_id read it like local hardware.

Still ahead: the Xcode .xip handoff, xtool setup with an Apple ID login, and the first actual hello-world install onto the phone. That’s part 2. The expensive part of “you need a Mac for iOS development” turned out to be replaceable with a free VM, a mini-PC we already owned, and one very long virtual USB cable.