How to build iPhone apps without a Mac using Claude Code and xtool
xtool is an open-source Xcode replacement for Linux and Windows (WSL). It builds a SwiftPM package into an iOS app, signs it, and installs it on an iPhone connected over USB. It hit GitHub's daily trending list, and a post on X suggesting you hand the whole setup to Claude Code spread widely.
You don't need a Mac, but you do need an Apple ID and Xcode.xip.
- Install the Swift 6.4 toolchain and usbmuxd. On Windows, set up USB passthrough to WSL (usbipd) first.
- Download Xcode 27 from developer.apple.com in a browser. It requires signing in and accepting the license, so curl won't work.
- Download xtool and put it on your PATH.
curl -fL "https://github.com/xtool-org/xtool/releases/latest/download/xtool-$(uname -m).AppImage" -o xtool
chmod +x xtool
sudo mv xtool /usr/local/bin/
- Run
xtool setupyourself in a terminal. Pick API Key if you're in the paid Apple Developer Program, otherwise Apple ID password. The password mode uses private Apple APIs, so the official docs suggest a throwaway Apple ID. Then give it the path to Xcode.xip and it generates an iOS Swift SDK.
Credentials and 2FA have to be typed by you, so do this part by hand and hand the rest to Claude Code.
Create a SwiftUI app with xtool new Hello and install it on my USB-connected iPhone with xtool dev
A single xtool dev builds, registers the device, creates the certificate and provisioning profile, signs, and installs. The first time, tap Trust on the iPhone and turn on Developer Mode. When you first open the app, trust your account under Settings > General > VPN & Device Management.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.