Swiftpack.co - Package - RobotsAndPencils/xcodes

xcodes

Manage the Xcodes installed on your Mac

CI Status

Installation

Homebrew (Preferred)

brew install robotsandpencils/made/xcodes

These are Developer ID-signed and notarized release builds and don't require Xcode to already be installed in order to use.

Other methods:

Download a release

Download the latest release from the Releases page. These are Developer ID-signed release builds and don't require Xcode to already be installed in order to use.

Using Mint
mint install RobotsAndPencils/xcodes
Build from source

Building from source requires Xcode 12.0 or later, so it's not an option for setting up a computer from scratch.

git clone https://github.com/RobotsAndPencils/xcodes
cd xcodes
make install
# or, if /usr/local/ isn't in your PATH
PREFIX=/your/install/directory make install

While installing, you may get the following output:

swift build
error: terminated(72): xcrun --sdk macosx --find xctest output:

If that occurs, it means you need to select a version of Xcode. You can do this with xcode-select or by choosing a Command Line Tools option in Xcode's preferences Locations tab.

Usage

Install a specific version of Xcode using a command like one of these:

xcodes install 10.2.1
xcodes install 11 Beta 7
xcodes install 11.2 GM seed
xcodes install --latest

You'll then be prompted to enter your Apple ID username and password. You can also provide these with the XCODES_USERNAME and XCODES_PASSWORD environment variables.

After successfully authenticating, xcodes will save your Apple ID password into the keychain and will remember your Apple ID for future use. If you need to use a different Apple ID than the one that's remembered, set the XCODES_USERNAME environment variable.

xcodes will download and install the version you asked for so that it's ready to use.

(1/6) Downloading Xcode 11.2.0: 100%
(2/6) Unarchiving Xcode (This can take a while)
(3/6) Moving Xcode to /Applications/Xcode-11.2.0.app
(4/6) Moving Xcode archive Xcode-11.2.0.xip to the Trash
(5/6) Checking security assessment and code signing
(6/6) Finishing installation
xcodes requires superuser privileges in order to finish installation.
macOS User Password:

Xcode 11.2.0 has been installed to /Applications/Xcode-11.2.0.app

If you have aria2 installed (it's available in Homebrew, brew install aria2), then xcodes will default to use it for downloads. It uses up to 16 connections to download Xcode 3-5x faster than URLSession.

Commands

  • install <version>: Download and install a specific version of Xcode
  • installed: List the versions of Xcode that are installed
  • list: List all versions of Xcode that are available to install
  • select: Change the selected Xcode
  • uninstall <version>: Uninstall a specific version of Xcode
  • update: Update the list of available versions of Xcode
  • version: Print the version number of xcodes itself

Development

You'll need Xcode 12 in order to build and run xcodes.

Using Xcode Even though xcodes is a command-line app, lll of the normal functionality works in Xcode, like building, running, and running tests. You can even type text into Xcode's console when it prompts you for input like your Apple ID or 2FA code.

When running xcodes from Xcode, if you want to run a particular command or pass some arguments, you can hold the option key to present a sheet with more options. This means you'd use Option + Command + R or hold Option while clicking the Run button. Here you can add, remove, and toggle arguments that will be passed to xcodes when it's launched.

Using Swift command line tools You can also use the Swift command line tools once you have Xcode installed:
  • Build: swift build
  • Run: swift run, or commands like swift run xcodes list
  • Run tests: swift test

There's a Makefile to help build xcodes for distribution. We already do this for you in order to provide Developer ID-signed and notarized release builds via Homebrew (see Installation).

Releasing a new version of xcodes
# Bump the version number in Version.swift, commit the change, and tag it
vim Sources/XcodesKit/Version.swift
git add Sources/XcodesKit/Version.swift
git commit -m "Bump version to $VERSION"
git tag -asm "$VERSION" "$VERSION"

# Clean first
make clean

# Make a release build of xcodes, sign it, and zip it
make zip
# Create a Homebrew bottle
make bottle VERSION="$VERSION"

# Notarize the release build
# This can take a while
make notarize \
    USERNAME="user@example.com" \
    PASSWORD="@keychain:ALTool Notarization" \
    ASC_PROVIDER="YourAppStoreConnectTeamName"

# Push the new version bump commit and tag
git push --follow-tags

# Edit the draft release created by Release Drafter to point at the new tag
# Set the release title to the new version
# Add the xcodes.zip and xcodes-$VERSION.mojave.tar.gz files to the release
# Publish the release

Notable design decisions are recorded in DECISIONS.md. The Apple authentication flow is described in Apple.paw, which will allow you to play with the API endpoints that are involved using the Paw app.

xcode-install and fastlane/spaceship both deserve credit for figuring out the hard parts of what makes this possible.

Contact

Made with ❤️ by Robots & Pencils

Twitter | GitHub

Github

link
Stars: 347

Used By

Total: 0

Releases

0.13.0 - 2020-10-21 19:23:11

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Add support for downloading with aria2 if it's already installed (#111) @interstateone
  • Retry installation when it fails because of damaged XIP (#110) @interstateone

0.12.0 - 2020-10-14 15:08:05

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Add support for 2FA accounts using SMS (#107) @interstateone
  • Look for Xcode-beta.app instead of Xcode-Beta.app (#109) @krzyzanowskim
  • Bump actions/checkout from v2.3.2 to v2.3.3 (#106) @dependabot

0.11.0 - 2020-08-29 03:59:04

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Add install flags for --latest and --latest-prerelease (#95) @interstateone
  • Bump actions/checkout from v2.3.1 to v2.3.2 (#99) @dependabot
  • Bump actions/checkout from v1 to v2.3.1 (#97) @dependabot

0.10.0 - 2020-05-09 00:09:02

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Add select command (#89) @interstateone
  • Ignore malformed Xcode app bundles (#88) @interstateone

0.9.0 - 2019-12-20 05:02:30

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Refactor to test and improve logging (#85) @interstateone
  • Improve command documentation (#81) @interstateone

0.8.1 - 2019-11-13 17:20:38

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Update Apple auth URLs (#84) @interstateone

0.8.0 - 2019-10-10 17:29:11

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Version 0.7.0 and later of xcodes are now notarized and ready for macOS Catalina.

Changes

  • Use Swift 5.1 and Xcode 11 (#77) @interstateone
  • Automate notarization (#74) @interstateone
  • Improve output for errors from underlying shell commands (#76) @interstateone

0.7.2 - 2019-09-24 02:49:20

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Consolidate versions from both download sites (#73) @interstateone

0.7.1 - 2019-09-17 00:46:50

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Improve GM seed version parsing and descriptions (#70) @interstateone
  • Replace CircleCI with GitHub Actions (#68) @interstateone

0.7.0 - 2019-08-30 03:16:26

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Check for existing Xcode archive before downloading (#66) @interstateone
  • Add uninstall command (#64) @interstateone
  • Ensure requested version isn't already installed before downloading (#63) @interstateone
  • Sign with hardened runtime and timestamp (#62) @interstateone
  • Move XIPs to Trash instead of immediately deleting them (#60) @interstateone

0.6.0 - 2019-07-02 22:39:26

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Improve prerelease version comparison (#55) @interstateone
  • Refactor to better define boundaries (#53) @interstateone
  • Swift 5 (#31) @interstateone

0.5.0 - 2019-06-11 13:47:17

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Your Apple ID username is now remembered after a successful login. If you need to use a different Apple ID than the one that's remembered, set the XCODES_USERNAME environment variable. (#46) @thii
  • Improve Gatekeeper error message, because Xcode 11 beta 1 fails the Gatekeeper assessment. (#51) @interstateone
  • Support developer.apple.com/download redesign, fixing support for listing beta releases. (#49) @interstateone
  • Update xcodes main errors to be more user friendly. (#45) @MattKiazyk

0.4.0 - 2019-05-16 00:54:54

If you installed xcodes with homebrew you can upgrade with brew upgrade robotsandpencils/made/xcodes.

Changes

  • Apple ID username and passwords are now saved to your keychain after successfully authenticating. Failed authentications will prompt for your password in order to retry, and will also remove the password saved to the keychain for the Apple ID username. Thanks to @MattKiazyk for their work on this functionality! (#25, #32, #42)
  • Added an xcodes version command that prints the current version of xcodes itself. Thanks to @daveanderson for the feature suggestion! (#29)
  • xcodes developers can run make project to generate an Xcode project. Thanks to @thii for this addition! (#43)
  • @juankaram added installation instructions for Mint (#24)
  • The code signing certificate and identifier, and the application support directory have changed to reflect the move from https://github.com/interstateone to https://github.com/robotsandpencils. The application support directory will be automatically migrated if necessary. (#39)
  • xcodes has CI building and running tests now

- 2019-03-20 02:37:32

Changes

  • xcodes list now ignores pre-release identifiers in available Xcode versions when determining which Xcodes are installed. This fixes an issue where pre-release versions wouldn't show that they were installed in the output, but it also means that if a newer pre-release version is available than one that you have installed, it will still show as installed. For example, if you have 10.2.0-beta.4 installed, and 10.2.0-beta.5 becomes available, xcodes list will print the line 10.2 Beta 5 (Installed). I'd like to further improve this in the future, but I think this matches xcode-version's behaviour for now.

- 2019-03-20 00:13:29

Changes

  • When a download fails in a way that it can be resumed, xcodes will automatically attempt to resume the download up to 3 times. After the third time it will exit, but you can run the same command again and it will attempt to resume from where it left off.
  • Improve error response handling when signing in
  • Fix pre-release version parsing

- 2019-03-15 01:48:14

Changes

  • In addition to providing an Apple ID username with the XCODES_USERNAME environment variable, you can now provide the password with XCODES_PASSWORD
  • Will attempt to use the version specified in an .xcode-version file in the current working directory if a version isn't provided as an argument when running the xcodes install command
  • Automatically updates the available Xcodes if needed when running xcodes install
  • Improves error messages and remove deliberate uses of fatalError

Initial Release - MVP - 2019-03-11 16:15:25

Supports installing Xcodes distributed as .xip files with Apple IDs using two-factor authentication.