xtool.git
Publicgit clone https://git.maproj.org/xtool.gitxtool.git / Documentation / xtool.docc / Installation-macOS.md
| 1 | # Installation (macOS) |
| 2 | |
| 3 | Set up xtool for declarative, Xcode-free iOS app development on macOS. |
| 4 | |
| 5 | ## Overview |
| 6 | |
| 7 | This article outlines the steps to install `xtool` for declarative, SwiftPM-driven iOS app development on macOS. |
| 8 | |
| 9 | ## Prerequisites |
| 10 | |
| 11 | ### Xcode |
| 12 | |
| 13 | Though we don't rely on the Xcode build system, you still need to install Xcode for the iOS SDK and toolchain. You'll want to [install Xcode](https://developer.apple.com/xcode/) and launch it once, completing any installation prompts. |
| 14 | |
| 15 | Confirm that Xcode is set up with the iOS SDK: |
| 16 | |
| 17 | ```bash |
| 18 | xcrun -sdk iphoneos -show-sdk-path |
| 19 | # /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk |
| 20 | ``` |
| 21 | |
| 22 | As well as Swift: |
| 23 | |
| 24 | ```bash |
| 25 | swift --version |
| 26 | # swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3) |
| 27 | # Target: arm64-apple-macosx15.0 |
| 28 | ``` |
| 29 | |
| 30 | ## Installation |
| 31 | |
| 32 | ### 1. Download xtool |
| 33 | |
| 34 | If you have [Homebrew](https://brew.sh), you can install xtool with |
| 35 | |
| 36 | ```bash |
| 37 | brew install xtool-org/tap/xtool |
| 38 | ``` |
| 39 | |
| 40 | Otherwise, you can download `xtool.app` from the [latest GitHub release](https://github.com/xtool-org/xtool/releases/latest). After moving it into `/Applications`, launch it and run the suggested script to add the `xtool` command to your `PATH`. |
| 41 | |
| 42 | > Note: |
| 43 | > |
| 44 | > If you install xtool manually, you'll also need to check for new GitHub releases and update it yourself. If you're interested in contributing support for auto-updates through Sparkle, pull requests are appreciated. See [issue #34 on GitHub](https://github.com/xtool-org/xtool/issues/34). |
| 45 | |
| 46 | Confirm that xtool is installed correctly: |
| 47 | |
| 48 | ```bash |
| 49 | xtool --help |
| 50 | # OVERVIEW: Cross-platform Xcode replacement |
| 51 | # ... |
| 52 | ``` |
| 53 | |
| 54 | ### 2. Configure xtool: log in |
| 55 | |
| 56 | Perform one-time setup with |
| 57 | |
| 58 | ```bash |
| 59 | xtool setup |
| 60 | ``` |
| 61 | |
| 62 | You'll be asked to log in: |
| 63 | |
| 64 | ``` |
| 65 | Select login mode |
| 66 | 0: API Key (requires paid Apple Developer Program membership) |
| 67 | 1: Password (works with any Apple ID but uses private APIs) |
| 68 | Choice (0-1): |
| 69 | ``` |
| 70 | |
| 71 | > Choosing a login mode: |
| 72 | > |
| 73 | > **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. |
| 74 | > |
| 75 | > **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. |
| 76 | |
| 77 | 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!) |
| 78 | |
| 79 | ## Next steps |
| 80 | |
| 81 | You're now ready to use xtool! See <doc:First-app>. (The tutorial is tailored to Linux, but it works the same on macOS.) |