Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,25 @@ jobs:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Checkout local package dependencies
run: |
set -euo pipefail

checkout_dependency() {
local repo="$1"
local checkout_path="$2"
local branch="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-}}"

if [ -n "$branch" ] && git ls-remote --exit-code --heads "https://github.com/${repo}.git" "$branch" >/dev/null; then
git clone --depth 1 --branch "$branch" "https://github.com/${repo}.git" "$checkout_path"
else
git clone --depth 1 "https://github.com/${repo}.git" "$checkout_path"
fi
}

checkout_dependency XcodesOrg/XcodesLoginKit ../XcodesLoginKit
checkout_dependency XcodesOrg/XcodesKit ../XcodesKit
- name: Run tests
env:
env:
DEVELOPER_DIR: /Applications/Xcode_16.4.app
run: swift test
45 changes: 23 additions & 22 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 17 additions & 34 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,83 +1,66 @@
// swift-tools-version:5.6
// swift-tools-version:6.0
import PackageDescription

let package = Package(
name: "xcodes",
platforms: [
.macOS(.v10_15)
.macOS(.v13),
.iOS(.v17)
],
products: [
.executable(name: "xcodes", targets: ["xcodes"]),
.library(name: "XcodesKit", targets: ["XcodesKit"]),
.library(name: "AppleAPI", targets: ["AppleAPI"]),
.library(name: "XcodesCLIKit", targets: ["XcodesCLIKit"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.1.4")),
.package(url: "https://github.com/mxcl/Path.swift.git", .upToNextMinor(from: "0.16.0")),
.package(url: "https://github.com/mxcl/Path.swift.git", from: "1.0.0"),
.package(url: "https://github.com/mxcl/Version.git", .upToNextMinor(from: "1.0.3")),
.package(url: "https://github.com/mxcl/PromiseKit.git", .upToNextMinor(from: "6.22.1")),
.package(url: "https://github.com/PromiseKit/Foundation.git", .upToNextMinor(from: "3.4.0")),
.package(url: "https://github.com/scinfu/SwiftSoup.git", .upToNextMinor(from: "2.0.0")),
.package(url: "https://github.com/mxcl/LegibleError.git", .upToNextMinor(from: "1.0.1")),
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", .upToNextMinor(from: "3.2.0")),
.package(url: "https://github.com/xcodereleases/data", revision: "fcf527b187817f67c05223676341f3ab69d4214d"),
.package(url: "https://github.com/onevcat/Rainbow.git", .upToNextMinor(from: "3.2.0")),
.package(url: "https://github.com/jpsim/Yams", .upToNextMinor(from: "5.0.1")),
.package(url: "https://github.com/xcodesOrg/swift-srp", branch: "main")
.package(path: "../XcodesLoginKit"),
.package(path: "../XcodesKit")
],
targets: [
.executableTarget(
name: "xcodes",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"XcodesKit"
"XcodesCLIKit",
.product(name: "XcodesKit", package: "XcodesKit")
]),
.testTarget(
name: "xcodesTests",
dependencies: [
"xcodes"
]),
.target(
name: "XcodesKit",
name: "XcodesCLIKit",
dependencies: [
"AppleAPI",
"KeychainAccess",
"LegibleError",
.product(name: "Path", package: "Path.swift"),
"PromiseKit",
.product(name: "PMKFoundation", package: "Foundation"),
"SwiftSoup",
"Unxip",
"Version",
.product(name: "XCModel", package: "data"),
"Rainbow",
"Yams"
]),
"XcodesLoginKit",
.product(name: "XcodesKit", package: "XcodesKit"),
"Rainbow"
],
path: "Sources/XcodesKit"),
.testTarget(
name: "XcodesKitTests",
dependencies: [
"XcodesKit",
"XcodesCLIKit",
.product(name: "XcodesKit", package: "XcodesKit"),
"Version"
],
resources: [
.copy("Fixtures"),
]),
.target(name: "Unxip"),
.target(
name: "AppleAPI",
dependencies: [
"PromiseKit",
.product(name: "PMKFoundation", package: "Foundation"),
"Rainbow",
.product(name: "SRP", package: "swift-srp")
]),
.testTarget(
name: "AppleAPITests",
dependencies: [
"AppleAPI"
],
resources: [
.copy("Fixtures"),
]),
]
)
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,18 @@ If you have [aria2](https://aria2.github.io) installed (it's available in Homebr

Xcode will be installed to /Applications by default, but you can provide the path to a different directory with the `--directory` option or the `XCODES_DIRECTORY` environment variable. All of the xcodes commands support this option, like `select` and `uninstall`, so you can manage Xcode versions that aren't in /Applications. xcodes supports having all of your Xcode versions installed in _one_ directory, wherever that may be.

### Architectures

The `list` and `runtimes` commands show architecture availability when Apple provides it. Universal downloads are labeled `[Universal]`, Apple Silicon-only downloads are labeled `[Apple Silicon]`, and Intel-only downloads are labeled `[Intel]`.

You can filter either list by architecture or variant with `--architecture arm64`, `--architecture x86_64`, `--architecture appleSilicon`, or `--architecture universal`. These filters are exact: `arm64` and `appleSilicon` show Apple Silicon-only downloads, `x86_64` shows Intel-only downloads, and `universal` shows downloads that support both architectures. The option can be used multiple times.

```sh
xcodes list --architecture arm64
xcodes list --architecture universal
xcodes runtimes --architecture arm64 --architecture universal --include-betas
```

### Install Runtimes :

Run this command line to display the available runtimes
Expand Down
Loading
Loading