xtool.git
Publicgit clone https://git.maproj.org/xtool.gitxtool.git / Documentation / xtool.docc / Installation-Linux.md
| 1 | # Installation (Linux/Windows) |
| 2 | |
| 3 | Set up xtool for iOS app development on Linux or Windows. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | This article outlines the steps to install `xtool` and begin developing iOS apps on Linux (or Windows via WSL). |
| 8 | |
| 9 | ## Prerequisites |
| 10 | |
| 11 | ### WSL (for Windows users) |
| 12 | |
| 13 | If you're on Windows, you can use xtool via [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install) (WSL). |
| 14 | |
| 15 | Once you install WSL, you'll also need to set up USB passthrough. See Microsoft's instructions on [installing USBIPD](https://learn.microsoft.com/en-us/windows/wsl/connect-usb). Make sure you're able to bind your iOS device to WSL via USB. |
| 16 | |
| 17 | > Note: |
| 18 | > |
| 19 | > If you encounter `Error: AFCClient.Error.muxError`, follow the steps described in [this issue comment](https://github.com/xtool-org/xtool/issues/19#issuecomment-2898986718) from user rena2019. |
| 20 | > |
| 21 | > This relays the device connection from iTunes on Windows, instead of relying on USBIPD. |
| 22 | |
| 23 | ### Swift |
| 24 | |
| 25 | Install the Swift 6.4 toolchain for your Linux distribution from <https://swift.org/install/linux>. |
| 26 | |
| 27 | After following the steps there, confirm that Swift is installed correctly: |
| 28 | |
| 29 | ```bash |
| 30 | swift --version |
| 31 | # should say something like: |
| 32 | # Swift version 6.4 (swift-6.4-RELEASE) |
| 33 | ``` |
| 34 | |
| 35 | ### usbmuxd |
| 36 | |
| 37 | xtool relies on [usbmuxd](https://github.com/libimobiledevice/usbmuxd) to talk to your iOS device from Linux. |
| 38 | |
| 39 | Your Linux distro probably offers this package, and it may be preinstalled. To check if it is, run |
| 40 | |
| 41 | ```bash |
| 42 | usbmuxd --help |
| 43 | # Usage: usbmuxd [OPTIONS] |
| 44 | # ... |
| 45 | ``` |
| 46 | |
| 47 | If instead you get "command not found", you need to install `usbmuxd` yourself. On Ubuntu/Debian, for example, you can do this with |
| 48 | |
| 49 | ```bash |
| 50 | sudo apt-get install usbmuxd |
| 51 | ``` |
| 52 | |
| 53 | > Other useful tools: |
| 54 | > |
| 55 | > `usbmuxd` is part of the [libimobiledevice](https://libimobiledevice.org) project. You may want to install other libimobiledevice tools, such as `ideviceinfo`, that offer many ways to interact with your iOS device from the command line. On Ubuntu/Debian, you can run |
| 56 | > |
| 57 | > ```bash |
| 58 | > sudo apt-get install libimobiledevice-utils |
| 59 | > # The following NEW packages will be installed: |
| 60 | > # libimobiledevice-utils |
| 61 | > # 0 upgraded, 1 newly installed |
| 62 | > ideviceinfo |
| 63 | > # DeviceName: Kabir's iPhone |
| 64 | > # SerialNumber: ... |
| 65 | > # UniqueDeviceID: ... |
| 66 | > # ... |
| 67 | > ``` |
| 68 | |
| 69 | ### Xcode.xip |
| 70 | |
| 71 | Download **Xcode 27.1** from <https://developer.apple.com/download/all/?q=Xcode>. Note the path where `Xcode.xip` is saved. |
| 72 | |
| 73 | > Note: |
| 74 | > |
| 75 | > The URL above requires authentication, so make sure to visit it in your browser rather than running `curl`. You'll be asked to log in with your Apple ID and accept the license agreement to download Xcode. |
| 76 | |
| 77 | ## Installation |
| 78 | |
| 79 | ### 1. Download xtool |
| 80 | |
| 81 | Once you have the prerequisites, download the [latest GitHub Release](https://github.com/xtool-org/xtool/releases/latest) of `xtool.AppImage` for your architecture. Rename it to `xtool` and add it to a location in your `PATH`. |
| 82 | |
| 83 | ```bash |
| 84 | curl -fL \ |
| 85 | "https://github.com/xtool-org/xtool/releases/latest/download/xtool-$(uname -m).AppImage" \ |
| 86 | -o xtool |
| 87 | chmod +x xtool |
| 88 | sudo mv xtool /usr/local/bin/ |
| 89 | ``` |
| 90 | |
| 91 | Confirm that xtool is installed correctly: |
| 92 | |
| 93 | ```bash |
| 94 | xtool --help |
| 95 | # OVERVIEW: Cross-platform Xcode replacement |
| 96 | # ... |
| 97 | ``` |
| 98 | |
| 99 | ### 2. Configure xtool: log in |
| 100 | |
| 101 | Perform one-time setup with |
| 102 | |
| 103 | ```bash |
| 104 | xtool setup |
| 105 | ``` |
| 106 | |
| 107 | You'll be asked to log in: |
| 108 | |
| 109 | ``` |
| 110 | Select login mode |
| 111 | 0: API Key (requires paid Apple Developer Program membership) |
| 112 | 1: Password (works with any Apple ID but uses private APIs) |
| 113 | Choice (0-1): |
| 114 | ``` |
| 115 | |
| 116 | > Choosing a login mode: |
| 117 | > |
| 118 | > **API Key:** If you have a paid [Apple Developer Program](https://developer.apple.com/programs/enroll/) membership, this is the recommended option. It relies on the public App Store Connect API. You'll want to follow the [instructions](https://developer.apple.com/documentation/appstoreconnectapi/creating-api-keys-for-app-store-connect-api) to generate a **Team Key** with the **App Manager** role. |
| 119 | > |
| 120 | > **Password:** If you aren't enrolled in the paid developer program, you'll want to use password-based authentication. This relies on private Apple APIs to authenticate, so you may want to create a throwaway Apple ID to be extra cautious. |
| 121 | |
| 122 | Once you select a login mode, you'll be asked to provide the corresponding credentials (API key or email+password+2FA). Needless to say, *your credentials are only sent to Apple* and nobody else (feel free to build xtool from source and check!) |
| 123 | |
| 124 | ### 3. Configure xtool: SDK |
| 125 | |
| 126 | After you're logged in, you'll be asked to provide the path to the `Xcode.xip` file you downloaded earlier. |
| 127 | |
| 128 | ``` |
| 129 | Choice (0-1): 0 |
| 130 | ... |
| 131 | Path to Xcode.xip: |
| 132 | ``` |
| 133 | |
| 134 | Enter the path (for example `~/Downloads/Xcode_27.1.xip`) and hit enter. xtool will extract the Xcode XIP to generate and install an iOS Swift SDK for you. |
| 135 | |
| 136 | Confirm that it worked: |
| 137 | |
| 138 | ```bash |
| 139 | swift sdk list |
| 140 | # darwin |
| 141 | ``` |
| 142 | |
| 143 | ## Next steps |
| 144 | |
| 145 | You're now ready to use xtool! See <doc:First-app>. |