The iPhone has had an SDK for as long as it's had apps, and the rule has always been the same: to build an iOS app you need a Mac running Xcode. xtool breaks that rule. It calls itself a cross-platform Xcode replacement that builds and deploys iOS apps with Swift Package Manager on Linux, Windows (through WSL) and macOS.

It was on GitHub Trending today, picking up more than a thousand stars in a day. It's written in Swift and licensed under MIT.

What it does

xtool reimplements the parts of Xcode you need to get an app onto a phone, using open standards instead of Xcode's project format. The project lists three jobs:

  • Build a SwiftPM package into an iOS app. No .xcodeproj, just a Package.swift.
  • Sign and install iOS apps on a real device.
  • Talk to Apple Developer Services from code: certificates, provisioning profiles, app IDs.

It also ships a library called XKit, so your own Swift programs can talk to Apple Developer Services and iOS devices the same way xtool does:

// package dependency:
.package(url: "https://github.com/xtool-org/xtool", .upToNextMinor(from: "1.2.0"))
// target dependency:
.product(name: "XKit", package: "xtool")

How it pulls it off

xtool doesn't pretend Apple's SDK doesn't exist. It uses the SDK, just without Xcode around it. Four pieces fit together:

The Swift toolchain. You install the official open-source Swift toolchain for Linux from swift.org. That gives you the compiler and SwiftPM.

A Darwin Swift SDK built from Xcode.xip. You download Xcode's .xip archive from Apple's developer site, but you never run it. During setup, xtool unpacks it and generates an iOS Swift SDK, the cross-compilation bundle SwiftPM uses to target another platform. Afterwards swift sdk list shows a darwin entry.

usbmuxd for the device. On Linux, xtool talks to your iPhone over USB through usbmuxd, the open-source daemon behind the libimobiledevice tools. On Windows you pass the USB device through to WSL with Microsoft's USBIPD.

Apple Developer Services. Signing means talking to Apple's servers. You can log in with an App Store Connect API key, which needs a paid Developer Program membership, or with an Apple ID and password, which works with any account but uses private APIs. The docs say your credentials only go to Apple.

With those in place, xtool compiles your package against the Darwin SDK, wraps the result in an app bundle, provisions and signs it, and installs it on the phone.

Trying it

The Linux/Windows install guide has the full steps. In short:

# prerequisites: Swift toolchain (swift.org), usbmuxd, and Xcode.xip from Apple
sudo apt-get install usbmuxd

# install xtool (it ships as an AppImage)
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/

# one-time setup: log in, then point it at Xcode.xip to build the SDK
xtool setup

After that, the command line will feel familiar if you've used cargo or npm:

xtool new       # create a new xtool SwiftPM project
xtool dev       # build and run it
xtool devices   # list connected devices
xtool install   # install an .ipa on your device
xtool launch    # launch an installed app
xtool ds        # interact with Apple Developer Services

The README's screenshot shows the whole loop running from VS Code, which makes sense as the editor once Xcode is out of the picture. The first-app tutorial walks you from an empty folder to an app on your phone.

The fine print

  • You still need Apple's SDK. xtool replaces the Xcode app, not Apple's SDK. You download Xcode.xip with an Apple ID, and Apple's license terms for it still apply.
  • Signing still goes through Apple. Free Apple IDs come with Apple's usual limits on sideloaded apps, and the password login relies on private APIs that Apple could change at any time.
  • It builds and deploys. That's all. There's no Interface Builder, Instruments or Simulator in its feature list, and App Store submission isn't a listed feature either.
  • It's SwiftPM-first. Your app is defined as a Swift package. That's cleaner, but an existing .xcodeproj app needs restructuring first.

Who it's for

  • Swift developers on Linux or Windows who want an app on their own iPhone without buying a Mac.
  • CI setups that would rather build iOS artifacts on cheap Linux runners than on macOS ones.
  • Mac users who are tired of .xcodeproj merge conflicts and want a declarative, package-based workflow from the terminal.
  • Tool builders who want to script Apple Developer Services and devices with XKit.

xtool won't retire Xcode overnight. What it does is turn "building an iOS app requires a Mac" into "building an iOS app requires a Swift toolchain and a USB cable." That opens iOS development to a lot more people.

The GitHub repo and the docs at xtool.sh are the places to start, and it's in the resource index now.

End of transmission.