|
| 1 | +--- |
| 2 | +title: xcodes |
| 3 | +description: Reference page for the xcodes resource |
| 4 | +--- |
| 5 | + |
| 6 | +The xcodes resource installs the [xcodes CLI](https://github.com/XcodesOrg/xcodes) tool and manages multiple Xcode versions on macOS. xcodes is the recommended way for iOS/macOS teams to ensure all developers are running the same Xcode version. |
| 7 | + |
| 8 | +Installing Xcode versions requires an Apple Developer account. xcodes will prompt for Apple ID credentials interactively on first use and caches them in the macOS Keychain. For non-interactive environments, supply `appleId` and `appSpecificPassword` directly in the resource config. |
| 9 | + |
| 10 | +## Parameters |
| 11 | + |
| 12 | +- **xcodeVersions**: *(string[])* List of Xcode versions to install (e.g. `["15.4", "14.3.1"]`). Version strings match what `xcodes list` shows — stable versions use a dotted number (`15.4`), beta/RC versions include the label (`15 Beta 3`). |
| 13 | +- **selected**: *(string)* The active Xcode version to use, equivalent to running `xcodes select`. Must be one of the installed `xcodeVersions`. |
| 14 | +- **appleId**: *(string, optional)* Apple ID email used to authenticate with Apple's servers when downloading Xcode. If omitted, xcodes will prompt interactively. |
| 15 | +- **appleIdPassword**: *(string, optional)* Apple ID password. Required alongside `appleId` for non-interactive installs. |
| 16 | + |
| 17 | +## Example usage |
| 18 | + |
| 19 | +```json title="codify.jsonc" |
| 20 | +[ |
| 21 | + { |
| 22 | + "type": "xcodes", |
| 23 | + "xcodeVersions": ["15.4"], |
| 24 | + "selected": "15.4", |
| 25 | + "os": ["macOS"] |
| 26 | + } |
| 27 | +] |
| 28 | +``` |
| 29 | + |
| 30 | +Multiple versions side by side: |
| 31 | + |
| 32 | +```json title="codify.jsonc" |
| 33 | +[ |
| 34 | + { |
| 35 | + "type": "xcodes", |
| 36 | + "xcodeVersions": ["14.3.1", "15.4"], |
| 37 | + "selected": "15.4", |
| 38 | + "os": ["macOS"] |
| 39 | + } |
| 40 | +] |
| 41 | +``` |
| 42 | + |
| 43 | +## Authentication |
| 44 | + |
| 45 | +xcodes requires Apple ID credentials to download Xcode from Apple's servers. On first install Codify will prompt for your credentials interactively (including two-factor authentication). The credentials are stored in the macOS Keychain for future use. |
| 46 | + |
| 47 | +For CI or fully non-interactive environments, add `appleId` and `appSpecificPassword` to the resource config: |
| 48 | + |
| 49 | +```json title="codify.jsonc" |
| 50 | +[ |
| 51 | + { |
| 52 | + "type": "xcodes", |
| 53 | + "xcodeVersions": ["15.4"], |
| 54 | + "selected": "15.4", |
| 55 | + "appleId": "your@apple.id", |
| 56 | + "appleIdPassword": "<Replace me here!>", |
| 57 | + "os": ["macOS"] |
| 58 | + } |
| 59 | +] |
| 60 | +``` |
| 61 | + |
| 62 | +Note that 2FA will still trigger interactively even with credentials set — xcodes does not support fully headless 2FA bypass. |
0 commit comments