GithubHelp home page GithubHelp logo

xcodeinstall's Introduction

Build & Test on EC2

Build & Test on GitHub

language platform license

This is a command line utility to download and install Xcode in headless mode (from a Terminal only).

TL;DR

Download Install

What is it

xcodeinstall is a command line utility to download and install Xcode from the terminal only. It may work interactively or unattended. In interactive mode, it prompts you for your Apple Developer account username, password and MFA code. In unattended mode, it fetches your Apple Developer username and password from AWS Secrets Manager. (Instructions to configure this are below).

When MFA is configured (which we highly recommend), a human interaction is required to enter the MFA code sent to your device. This step cannot be automated.

The Apple Developer Portal username and password ARE NOT STORED on the local volume. They are used to interact with Apple's Developer Portal API and collect a session token. The session token is stored in $HOME/.xcodeinstall or on AWS Secrets Manager.

When using AWS Secrets Manager, Apple session token and cookies are securely stored on AWS Secrets Manager. The session token and cookies may be shared from multiple cloud machines. For example: you may authenticate interactively, using MFA, from your laptop, and have the command running unattended, from a script running on your cloud machine.

The session stays valid for several days, sometimes weeks before it expires. When the session expires, you have to authenticate again. Apple might prompts you for a new authentication when connecting from a new IP address or location (switching between laptop and EC2 instance for example)

When using Secrets Manager for authentication, it is required to use it FROM THE SAME AWS REGION, for the list and download command.

Demo

Video Demo

Why install Xcode in headless mode?

When preparing a macOS machine in the cloud for CI/CD, you don't always have access to the login screen, or you don't want to access it.

It is a best practice to automate the preparation of your build environment to ensure they are always identical.

How to install

Most of you are not interest by the source code. To install the brinary, use homebrew package manager and install a custom tap, then install the package.

First, install the custom tap. This is a one-time operation.

~ brew tap sebsto/macos

==> Tapping sebsto/macos
Cloning into '/opt/homebrew/Library/Taps/sebsto/homebrew-macos'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), 5.55 KiB | 5.55 MiB/s, done.
Tapped 1 formula (13 files, 21.7KB).

Once the tap is added, install the package by typing brew install xcodeinstall

~ brew install xcodeinstall 

==> Downloading https://github.com/sebsto/xcodeinstall/archive/refs/tags/v0.1.tar.gz
Already downloaded: /Users/stormacq/Library/Caches/Homebrew/downloads/03a2cadcdf453516415f70a35b054cdcfb33bd3a2578ab43f8b07850b49eb19c--xcodeinstall-0.1.tar.gz
==> Installing xcodeinstall from sebsto/macos
🍺  /opt/homebrew/Cellar/xcodeinstall/0.2: 8 files, 25.6MB, built in 2 seconds
==> Running `brew cleanup xcodeinstall`...

Once installed, it is in the path, you can just type xcodeinstall to start the tool.

How to use

Overview

➜  ~ xcodeinstall

OVERVIEW: A utility to download and install Xcode

USAGE: xcodeinstall [--verbose] <subcommand>

OPTIONS:
  -v, --verbose           Produce verbose output for debugging
  --version               Show the version.
  -h, --help              Show help information.

SUBCOMMANDS:
  authenticate            Authenticate yourself against Apple Developer Portal
  signout                 Signout from Apple Developer Portal
  list                    List available versions of Xcode and development tools
  download                Download the specified version of Xcode
  install                 Install a specific XCode version or addon package

  See 'xcodeinstall help <subcommand>' for detailed help.

Authentication

➜  ~ xcodeinstall authenticate -h 

OVERVIEW: Authenticate yourself against Apple Developer Portal

USAGE: xcodeinstall authenticate [--verbose]

OPTIONS:
  -v, --verbose           Produce verbose output for debugging
  -s, --secretmanager-region <secretmanager-region>
                          Instructs to use AWS Secrets Manager to store and read secrets in the given AWS Region  
  --version               Show the version.
  -h, --help              Show help information.

Interactive authentication

➜  ~ xcodeinstall authenticate    

⚠️⚠️⚠️
This tool prompts you for your Apple ID username, password, and two factors authentication code.
These values are not stored anywhere. They are used to get an Apple session ID.

The Session ID is securely stored on your AWS Account, using AWS Secrets Manager.
The AWS Secrets Manager secret name is "xcodeinstall_session"

⌨️  Enter your Apple ID username: <your apple id email>
⌨️  Enter your Apple ID password: 
Authenticating...
🔐 Two factors authentication is enabled, enter your 2FA code: 000000
✅ Authenticated with MFA.

Using AWS Secrets Manager

When your Apple Developer Portal credentials are stored on AWS Secrets Manager, you can just specify the AWS Region

➜  ~ xcodeinstall authenticate -s us-east-1

Retrieving Apple Developer Portal credentials...
Authenticating...
🔐 Two factors authentication is enabled, enter your 2FA code: 00000
✅ Authenticated with MFA.

When using Secrets Manager for authentication, it is required to use it FROM THE SAME AWS REGION, for the list and download command.

The two above command (interactive and AWS Secrets Manager based) triggers the following prompt on your registered machines (laptop, phone, or tablet)

Apple MFA Authorization

Apple MFA code

List files available to download

➜  ~ xcodeinstall list -h
OVERVIEW: List available versions of Xcode and development tools

USAGE: xcodeinstall list [--verbose] [--force] [--only-xcode] [--xcode-version <xcode-version>] [--most-recent-first] [--date-published]

OPTIONS:
  -v, --verbose           Produce verbose output for debugging
  -f, --force             Force to download the list from Apple Developer Portal, even if we have it in the cache
  -o, --only-xcode        Filter on Xcode package only
  -x, --xcode-version <xcode-version>
                          Filter on provided Xcode version number (default: 13)
  -m, --most-recent-first Sort by most recent releases first
  -d, --date-published    Show publication date
  -s, --secretmanager-region <secretmanager-region>
                          Instructs to use AWS Secrets Manager to store and read secrets in the given AWS Region  
  --version               Show the version.
  -h, --help              Show help information.

Download file

➜  ~ xcodeinstall download -h
OVERVIEW: Download the specified version of Xcode

USAGE: xcodeinstall download [--verbose] [--force] [--only-xcode] [--xcode-version <xcode-version>] [--most-recent-first] [--date-published] [--name <name>]

OPTIONS:
  -v, --verbose           Produce verbose output for debugging
  -f, --force             Force to download the list from Apple Developer Portal, even if we have it in the cache
  -o, --only-xcode        Filter on Xcode package only
  -x, --xcode-version <xcode-version>
                          Filter on provided Xcode version number (default: 13)
  -m, --most-recent-first Sort by most recent releases first
  -d, --date-published    Show publication date
  -n, --name <name>       The exact package name to downloads. When omited, it asks interactively
  -s, --secretmanager-region <secretmanager-region>
                          Instructs to use AWS Secrets Manager to store and read secrets in the given AWS Region
  --version               Show the version.
  -h, --help              Show help information.

When you known the name of the file (for example Xcode 13.4.1.xip), you can use the --name option, otherwise it prompts your for the file name.

xcodeinstall download --name "Xcode 13.4.1.xip"

Install file

This tool call sudo to install packages. Be sure your userid has a a sudoers file configured to not prompt for a password.

➜  ~ cat /etc/sudoers.d/your_user_id 
# Give your_user_id sudo access
your_user_id ALL=(ALL) NOPASSWD:ALL
➜  ~ xcodeinstall install -h 
OVERVIEW: Install a specific XCode version or addon package

USAGE: xcodeinstall install [--verbose] [--name <name>]

OPTIONS:
  -v, --verbose           Produce verbose output for debugging
  -n, --name <name>       The exact package name to install. When omited, it asks interactively
  --version               Show the version.
  -h, --help              Show help information.

When you known the name of the file (for example Xcode 13.4.1.xip), you can use the --name option, otherwise it prompts your for the file name.

xcodeinstall install --name "Xcode 13.4.1.xip"

Minimum IAM Permissions required to use AWS Secrets Manager

The minimum IAM permisions required to use this tool with AWS Secrets Manager is as below (do not forget to replace 000000000000 with your AWS Account ID)

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "xcodeinstall",
            "Effect": "Allow",
            "Action": [
                "secretsmanager:CreateSecret",
                "secretsmanager:GetSecretValue",
                "secretsmanager:PutSecretValue"
            ],
            "Resource": "arn:aws:secretsmanager:*:000000000000:secret:xcodeinstall-*"
        }
    ]
}

Once associated with an IAM Role, you can attach the role to any IAM principal : user, group or an AWS service, such as an EC2 Mac instance. Here are instructions to do so.

Create an IAM role that contains the minimum set of permissions to allow xcodeinstall to interact with AWS Secrets Manager, then attach this role to the EC2 Mac instance where you run xcodeinstall.

From a machine where the AWS CLI is installed and where you have AWS credentials allowing you to create roles and permissions (typically your laptop), type the following commands :

  1. First create a role that can be attached (trusted) by any EC2 instances:
# Create the trust policy file 
cat << EOF > ec2-role-trust-policy.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": { "Service": "ec2.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }
  ]
}
EOF

# Create the role itself (with no permission at the moment)
aws iam create-role \
    --role-name xcodeinstall \
    --assume-role-policy-document file://ec2-role-trust-policy.json
  1. Second, create a policy that contains the minimum set of permissions to interact with AWS Secrets Manager
# Create the policy file with the set of permissions
# CHANGE 000000000000 with your AWS Account ID
cat << EOF > ec2-policy.json 
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "xcodeinstall",
            "Effect": "Allow",
            "Action": [
                "secretsmanager:CreateSecret",
                "secretsmanager:GetSecretValue",
                "secretsmanager:PutSecretValue"
            ],
            "Resource": "arn:aws:secretsmanager:*:000000000000:secret:xcodeinstall-*"
        }
    ]
}
EOF

# Create the policy 
aws iam create-policy                      \
    --policy-name xcodeinstall-permissions \
    --policy-document file://ec2-policy.json
  1. Third, attach the policy to the role
# Attach a policy to a role 
# CHANGE 000000000000 with your AWS Account ID
aws iam attach-role-policy                                                     \
     --policy-arn arn:aws:iam::000000000000:policy/xcodeinstall-permissions    \
     --role-name xcodeinstall
  1. Fourth, attach the role to your EC2 Mac instance (through an instance profile)
# Create an instance profile 
aws iam create-instance-profile                   \
     --instance-profile-name xcodeinstall-profile

# Attach the role to the profile
aws iam add-role-to-instance-profile             \
    --instance-profile-name xcodeinstall-profile \
    --role-name xcodeinstall   

# Identify the Instance ID of your EC2 Mac Instance.
# You may use the AWS Console or search by tags like this (replace the tag value with yours)
INSTANCE_ID=$(aws ec2 describe-instances                                                 \
               --filter "Name=tag:Name,Values=M1 Monterey"                               \
               --query "Reservations[].Instances[?State.Name == 'running'].InstanceId[]" \
               --output text)

# verify you have an ID (you may add --region to target the correct AWS Region)
echo $INSTANCE_ID

# Associate the profile to the instance 
aws ec2 associate-iam-instance-profile \
    --instance-id $INSTANCE_ID         \
    --iam-instance-profile Name="xcodeinstall-profile"

When you start other EC2 Mac instance, you just need to attach the profile to the new instance. The Policy and Role can be reused for multiple EC2 instances.

How to store your secrets on AWS Secrets Manager

When using AWS Secrets Manager to retrieve your Apple Developer Portal username and password, you have to prepare an AWS Secrets Manager secret as following:

  • secret name : xcodeinstall-apple-credentials
  • secret format : a JSON string similar to this one :
{"username":"your_username","password":"your_password"}

To help you to create this secret, you may use the following command.

Be sure to adjust the name of the AWS Region to your requirements. Using an AWS Region geographically close to you helps to reduce latency)

~ xcodeinstall storesecrets -s us-east-1

This command captures your Apple ID username and password and store them securely in AWS Secrets Manager.
It allows this command to authenticate automatically, as long as no MFA is prompted.

⌨️  Enter your Apple ID username: [email protected]
⌨️  Enter your Apple ID password: 
✅ Credentials are securely stored

How to contribute

I welcome all type of contributions, not only code : testing and creating bug report, documentation, tutorial etc... If you are not sure how to get started or how to be useful, contact me at [email protected]

I listed a couple of ideas below.

List of ideas

  • add a CloudWatch Log backend to Logging framework
  • add possibility to emit SNS notifications on error, such as Session Expired
  • clean room implementation of progres sbar to remove dependency on Swift Tools Core library

Credits

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

xcodeinstall's People

Contributors

sebsto avatar renovate[bot] avatar

Stargazers

Nati Cohen avatar Manuel Zimmermann avatar solaren avatar Omari avatar Pranav avatar  avatar Michael Bachand avatar Ellis Breen avatar  avatar Josh L avatar cc-glani avatar Ilia Shoshin avatar  avatar Paul Greenberg avatar  avatar Rinalds Domanovs avatar adam kaminski avatar Scripts and Things avatar James Smith avatar Nat Burgwyn avatar Patrick Watson avatar Matija Grcic avatar Jon Schwenn avatar Andrew Pearce avatar Stephen Johnson avatar Artem Zhurbila avatar John Hutchison avatar EslamMohammed avatar Balázs Buri avatar Darko Mesaros avatar  avatar Mitch Larsen avatar Chris Potrebka avatar  avatar Igor avatar Eyüp Fidan avatar Robert Audi avatar Ricardo Sueiras avatar Carlos D. Álvaro avatar

Watchers

 avatar  avatar Chris Potrebka avatar  avatar

Forkers

meechee

xcodeinstall's Issues

Keeps asking for MFA

Describe the bug
I wrote a script that includes xcodeinstall authenticate -s us-east-1 at the top of it and it always requests a new MFA code. Is there a way to tell if xcodeinstall is already authenticated or is this a bug?

I have the AWS creds set up as environment variables AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID. It seems to get populated on AWS.

Fail to unmount Command Line Tools.dmg after installation

Describe the bug
At the end of CLI installation, the command fails to unmount the DMG file

To Reproduce
install CLI

Expected behavior
no error

2022-12-05T12:25:07+0100 error xcodeinstall : [xcodeinstall] Can not unmount volume : file:///Volumes/Command%20Line%20Developer%20Tools/
Optional(CLIlib.ShellOutput(out: Optional(""), err: Optional("hdiutil: unmount: \"file:///Volumes/Command%20Line%20Developer%20Tools/\" failed to unmount due to error 2.\nhdiutil: unmount failed - No such file or directory\n"), code: 1))
🛑 Error while installing file:///Users/stormacq/.xcodeinstall/download/Command%20Line%20Tools%20for%20Xcode%2014.1.dmg

The %20 are added by URL class and should be remove when passing path to command line shell

Some MFA API Answer can not be decoded

Describe the bug
Apple MFA API returns different JSON for different users. Some fails to be parsed and causes the app to crash

To Reproduce
I do not know what Apple Developer Account are returning more or less JSON keys in the API response.

Here is one that fails with v0.4

{
  "trustedPhoneNumbers" : [ {
    "numberWithDialCode" : "+44 ••••• ••••24",
    "pushMode" : "sms",
    "lastTwoDigits" : "24",
    "obfuscatedNumber" : "••••• ••••24",
    "id" : 1
  } ],
  "securityCode" : {
    "length" : 6,
    "tooManyCodesSent" : false,
    "tooManyCodesValidated" : false,
    "securityCodeLocked" : false,
    "securityCodeCooldown" : false
  },
  "authenticationType" : "hsa2",
  "recoveryUrl" : "https://iforgot.apple.com/phone/add?prs_account_nm=ricsue%40amazon.co.uk&autoSubmitAccount=true&appId=142",
  "cantUsePhoneNumberUrl" : "https://iforgot.apple.com/iforgot/phone/add?context=cantuse&prs_account_nm=ricsue%40amazon.co.uk&autoSubmitAccount=true&appId=142",
  "recoveryWebUrl" : "https://iforgot.apple.com/password/verify/appleid?prs_account_nm=ricsue%40amazon.co.uk&autoSubmitAccount=true&appId=142",
  "repairPhoneNumberUrl" : "https://gsa.apple.com/appleid/account/manage/repair/verify/phone",
  "repairPhoneNumberWebUrl" : "https://appleid.apple.com/widget/account/repair?#!repair",
  "aboutTwoFactorAuthenticationUrl" : "https://support.apple.com/kb/HT204921",
  "autoVerified" : false,
  "showAutoVerificationUI" : false,
  "supportsCustodianRecovery" : false,
  "hideSendSMSCodeOption" : false,
  "supervisedChangePasswordFlow" : false,
  "trustedPhoneNumber" : {
    "numberWithDialCode" : "+44 ••••• ••••24",
    "pushMode" : "sms",
    "lastTwoDigits" : "24",
    "obfuscatedNumber" : "••••• ••••24",
    "id" : 1
  },
  "hsa2Account" : true,
  "restrictedAccount" : false,
  "supportsRecovery" : true,
  "managedAccount" : false
}

It fails because properties like twoFactorVerificationSupportUrl, hasRecoveryKey are not present.
https://github.com/sebsto/xcodeinstall/blob/main/Sources/xcodeinstall/API/AuthenticationMFA.swift#L89

Manage installation of multiple Xcode versions

Is your feature request related to a problem? Please describe.
The tool should support installing multiple Xcode versions

Describe the solution you'd like
Move Xcode.app to /Applications and rename the package with version number
Use Symlink to point to the version currently being used

ec2-user@ip-172-31-5-66 /Applications % ls -al 
total 0
drwxrwxr-x   8 root      admin  256 Oct 20 05:40 .
drwxr-xr-x  20 root      wheel  640 Aug 11 06:44 ..
-rw-r--r--   1 root      wheel    0 Aug 11 06:44 .localized
drwxr-xr-x@  3 root      wheel   96 Oct 12 18:36 Safari.app
drwxr-xr-x   3 root      wheel   96 Aug 11 06:44 Utilities
drwxr-xr-x   3 ec2-user  staff   96 May 18 04:10 Xcode-13.4.1.app
drwxr-xr-x   3 ec2-user  staff   96 Sep 14 13:01 Xcode-14.0.1.app
lrwxr-xr-x   1 ec2-user  admin   16 Oct 20 05:40 Xcode.app -> Xcode-14.0.1.app

Describe alternatives you've considered
n/a

Additional context
n/a

Enable passing of credentials via command line flags

Is your feature request related to a problem? Please describe.
I would like to run xcodeinstall on a GitHub Actions hosted Runner.

Describe the solution you'd like
Enable the passing of credentials in either ENV variables or via command line flags rather than an interactive prompt. I could then store the username and password in GitHub Secrets reducing the reliance on passing the creds via an interactive script wrapper or storing them in AWS.

Additional context
I'm not looking to use xcodeinstall to install Xcode but instead download the xip, then upload that xip to a management server for distribution out to my engineer's devices from our management system (Jamf Pro)

Change CLIProgressBar implementation to reduce dependencies

The CLI progress bar uses class Progress Animation that comes from Swift Tools Support Core library.
This Library is huge and has a lot of dependencies. I would like to avoid downloading and compiling all this code just for a progress bar.

There are alternatives to be inspired from (or to reuse directly)

https://github.com/vapor/console-kit/tree/main/Sources/ConsoleKit/Activity
https://github.com/nsscreencast/469-swift-command-line-progress-bar
https://github.com/jkandzi/Progress.swift/blob/master/Sources/Progress.swift

Add the possibility to send SNS notifications on authentication errors

When Apple expires the session, it is likely to ask for a MFA again at next authentication. This step can not be automated, a human person has to connect to the machine, start the authentication sequence and enter the MFA code when prompted.

When API calls fails on authentication error, It would be great to send a notification to SNS to allow to automate the notification to human person

Swift 5.9 : unit tests fail with linker error

Describe the bug
When the root package manifest declares a tools version of at least 5.9, the commands swift test or swift build --build-test fails with linker error for symbols that are a dependency of the main project.

This is very similar to what is decsribed here, except that I can reproduce this on macOS 14.1 too
apple/swift-package-manager#6940 (comment)

To Reproduce

# be sure to have Swift 5.9 installed 
git clone https://github.com/sebsto/xcodeinstall.git 
cd xcodeinstall 
# change tool version to 5.9 in `Package.swift`
swift test

Detailed error messages

Building for debugging...
ld: Undefined symbols:
  ArgumentParser.ArgumentVisibility.default.unsafeMutableAddressor : ArgumentParser.ArgumentVisibility, referenced from:
      default argument 1 of ArgumentParser.OptionGroup.init(title: Swift.String, visibility: ArgumentParser.ArgumentVisibility) -> ArgumentParser.OptionGroup<A> in CLIAuthenticate.swift.o
  ArgumentParser.ArgumentHelp.init(stringLiteral: Swift.String) -> ArgumentParser.ArgumentHelp, referenced from:
      variable initialization expression of xcodeinstall.MainCommand.Download.(_name in _EB4AB93595B2E1C16A7F4A6D2B09C29A) : ArgumentParser.Option<Swift.String?> in CLIDownload.swift.o
      xcodeinstall.MainCommand.Download.init() -> xcodeinstall.MainCommand.Download in CLIDownload.swift.o
      xcodeinstall.MainCommand.Download.init(from: Swift.Decoder) throws -> xcodeinstall.MainCommand.Download in CLIDownload.swift.o
      default argument 3 of xcodeinstall.MainCommand.Download.init(globalOptions: ArgumentParser.OptionGroup<xcodeinstall.MainCommand.GlobalOptions>, downloadListOptions: ArgumentParser.OptionGroup<xcodeinstall.MainCommand.DownloadListOptions>, cloudOption: ArgumentParser.OptionGroup<xcodeinstall.MainCommand.CloudOptions>, name: ArgumentParser.Option<Swift.String?>) -> xcodeinstall.MainCommand.Download in CLIDownload.swift.o
      variable initialization expression of xcodeinstall.MainCommand.Install.(_name in _48DC8EDB848BB62F56E00CA5D15CEE92) : ArgumentParser.Option<Swift.String?> in CLIInstall.swift.o
      xcodeinstall.MainCommand.Install.init() -> xcodeinstall.MainCommand.Install in CLIInstall.swift.o
      xcodeinstall.MainCommand.Install.init(from: Swift.Decoder) throws -> xcodeinstall.MainCommand.Install in CLIInstall.swift.o
      ...

Workarounds

There are two workaround I found

  1. Revert back tool version to 5.8 in Package.swift
  • or -
  1. use xcodebuild test -scheme xcodeinstall to run the unit tests. When run by Xcode (command line or GUI), there is no linker error. But this is a macOS only workaround.

Some apple developer id account needs to be updated - improved error handling

Describe the bug
Some old apple developer id account receive an error message on List operation, with HTTP status code 200

To Reproduce

  • authenticate with an old apple developer id account (I don't have one)
  • call list operation

Result
🛑 Unexpected error : unknownError(errorCode: 2170)

Expected behavior
Clear error report with the message returned by apple
This is what List operation returns

            // reported by Matthew Brace <[email protected]>
            /*
            {"responseId":"4a09c41c-f010-4ef0-ae03-66787439f918","resultCode":2170,"resultString":"Your developer account needs to be updated.  Please visit Apple Developer Registration.","userString":"Your developer account needs to be updated.  Please visit Apple Developer Registration.","creationTimestamp":"2022-11-29T23:50:58Z","protocolVersion":"QH65B2","userLocale":"en_US","requestUrl":"https://developer.apple.com/services-account/QH65B2/downloadws/listDownloads.action","httpCode":200}
            */

Can not install on x86 Mac

Describe the bug
The brew formula can not be installed on x86 Mac

To Reproduce

brew tab sebsto/macOS
brew install xcodeinstall 

==> Downloading https://github.com/sebsto/xcodeinstall/archive/refs/tags/v0.2.tar.gz
==> Downloading from https://codeload.github.com/sebsto/xcodeinstall/tar.gz/refs/tags/
                      #    #     #     #                                -=O=-
==> Installing xcodeinstall from sebsto/macos
Error: The following formula cannot be installed from bottle and must be
built from source.
  xcodeinstall
Install the Command Line Tools:
  xcode-select --install

Expected behavior
brew should provide binaries for x86 machines

Authenticating from SecretsManager with expired session always fails

Describe the bug
When trying to authenticate using Secrets Manager and there is an expired session store in Secrets Manager, XCI fails (Authentication error) but does not prompt for new credentials. It obliges users to call signout and storesecrets again to unlock

To Reproduce

ec2-user@ip-172-31-5-69 ~ % xcodeinstall authenticate -s us-east-1
Retrieving Apple Developer Portal credentials...
Authenticating...
🛑 Invalid username or password.

Expected behavior
When authentication fails and Secrets Manager is used, the command should ask for credentials again and restart a clean cycle

Desktop (please complete the following information):

  • OS: [e.g. macOS 12.5]
  • xcodeinstall version [e.g. 0.1] : 0.5

Additional context
Only when using Secrets Manager

Check if there is a sudoers file

install requires root privileges.
xcodeinstall install uses sudo

The command should check if /etc/sudoers.d/your_user_id exists and prompt to create one with

# Give your_user_id sudo access
your_user_id ALL=(ALL) NOPASSWD:ALL

fail to parse list of packages

Describe the bug
When parsing the download list, xcodeinstall fails with

🛑 Unknown download error : parsingError(error: Swift.DecodingError.valueNotFound(Swift.Array<Swift.String>, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "downloads", intValue: nil), _JSONKey(stringValue: "Index 1126", intValue: 1126), CodingKeys(stringValue: "files", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "displayName", intValue: nil)], debugDescription: "Cannot get unkeyed decoding container -- found null value instead", underlyingError: nil)))
Please file an error report at https://github.com/sebsto/xcodeinstall/issues/new?assignees=&labels=&template=bug_report.md&title=
🛑 Unexpected error : parsingError(error: Swift.DecodingError.valueNotFound(Swift.Array<Swift.String>, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "downloads", intValue: nil), _JSONKey(stringValue: "Index 1126", intValue: 1126), CodingKeys(stringValue: "files", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "displayName", intValue: nil)], debugDescription: "Cannot get unkeyed decoding container -- found null value instead", underlyingError: nil)))

To Reproduce

xcodeinstall list -m -x 15 --verbose

Do not forget to

  1. type the exact command you typed, including all inputs and output
  2. run the command with --verbose to collect debugging output

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. macOS 12.5]
  • xcodeinstall version [e.g. 0.1]

Additional context
Add any other context about the problem here.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build_and_test.yml
  • actions/checkout v4
.github/workflows/build_and_test_gh_hosted.yml
  • actions/checkout v4
  • macos 13
swift
Package.swift
  • apple/swift-argument-parser from: "1.3.0"
  • soto-project/soto from: "6.8.0"
  • sebsto/CLIlib from: "0.1.1"

  • Check this box to trigger a request for Renovate to run again on this repository

Account with SMS 2FA fails to authenticate

Describe the bug
When an account is developer only account (never signin as iCloud on a device), the MFA sequence is different and xcodefails to authenticate user

To Reproduce
xcodeinstall authenticate with a developer only account

Do not forget to

  1. type the exact command you typed, including all inputs and output
  2. run the command with --verbose to collect debugging output
dsx @ 💻🈳  ~ % xcodeinstall authenticate -v
Retrieving Apple Developer Portal credentials...
⚠️⚠️ We prompt you for your Apple ID username, password, and two factors authentication code.
These values are not stored anywhere. They are used to get an Apple session ID. ⚠️⚠️

Alternatively, you may store your credentials on AWS Secrets Manager
⌨️  Enter your Apple ID username: [email protected]
⌨️  Enter your Apple ID password: 
Authenticating...
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] ⚠️ I could not load session (this is normal the first time you authenticate)
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] ⚠️ I could not load cookies (this is normal the first time you authenticate)
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - - OUTGOING - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] https://appstoreconnect.apple.com/olympus/v1/app/config?hostname=itunesconnect.apple.com 


GET /olympus/v1/app/config?hostname=itunesconnect.apple.com HTTP/1.1 

HOST: appstoreconnect.apple.com
X-Requested-With: XMLHttpRequest
Content-Type: application/json
Accept: application/json, text/javascript
User-Agent: curl/7.79.1

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - -  END - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - - INCOMMING - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] https://appstoreconnect.apple.com/olympus/v1/app/config?hostname=itunesconnect.apple.com

HTTP 200 /olympus/v1/app/config?hostname=itunesconnect.apple.com
Host: appstoreconnect.apple.com
apple-tk: false
x-frame-options: SAMEORIGIN
x-b3-spanid: 05432fda5e99e675
Cache-Control: private, no-transform, max-age=0
x-apple-jingle-correlation-key: ES52ZRQZ5XPC3DCVQUHCSHDGRY
Content-Encoding: gzip
Content-Type: application/json
Server: daiquiri/3.0.0
x-xss-protection: 1; mode=block
apple-originating-system: UnknownOriginatingSystem
Content-Length: 142
x-apple-request-uuid: 24bbacc6-19ed-de2d-8c55-850e291c668e
Vary: Accept-Encoding
x-content-security-policy: script-src 'self' *.apple.com
x-responding-instance: olympus-rest:20192:mr24p00it-ztdv08032001:9002:22N37
x-daiquiri-instance: daiquiri:15751003:mr36p00it-hyhk06054801:7987:22RELEASE148:daiquiri-amp-dsce-asc-int-002-mr, daiquiri:18493001:mr85p00it-hyhk03154801:7987:22RELEASE148:daiquiri-amp-all-shared-ext-001-mr
b3: 24bbacc619edde2d8c55850e291c668e-05432fda5e99e675
x-content-type-options: nosniff
apple-seq: 0.0
Date: Fri, 21 Oct 2022 14:17:05 GMT
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
x-b3-traceid: 24bbacc619edde2d8c55850e291c668e

{
  "authServiceUrl" : "https://idmsa.apple.com/appleauth",
  "authServiceKey" : "e0b80c3bf78523bfe80974d320935bfa30add02e1bff88ec2166c6bd5a706c42"
}

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - -  END - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] Got an Apple Service key : Optional(xcodeinstall.AppleServiceKey(authServiceUrl: "https://idmsa.apple.com/appleauth", authServiceKey: "e0b80c3bf78523bfe80974d320935bfa30add02e1bff88ec2166c6bd5a706c42"))
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] ⚠️ I could not load session (this is normal the first time you authenticate)
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] ⚠️ I could not load cookies (this is normal the first time you authenticate)
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - - OUTGOING - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] https://idmsa.apple.com/appleauth/auth/signin 


POST /appleauth/auth/signin? HTTP/1.1 

HOST: idmsa.apple.com
Accept: application/json, text/javascript
Content-Type: application/json
X-Requested-With: XMLHttpRequest
X-Apple-Widget-Key: e0b80c3bf78523bfe80974d320935bfa30add02e1bff88ec2166c6bd5a706c42
User-Agent: curl/7.79.1

 {"rememberMe":false,"accountName":"[email protected]","password":"*****"}
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - -  END - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - - INCOMMING - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] https://idmsa.apple.com/appleauth/auth/signin

HTTP 409 /appleauth/auth/signin?
Host: idmsa.apple.com
X-Apple-Auth-Attributes: MYbdkWpt0xTNuFvx3mIAFbzcO4ZeDw==
Cache-Control: no-cache, no-store, no-store
Vary: accept-encoding
Content-Type: application/json;charset=UTF-8
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Apple-ID-Account-Country: USA
X-Apple-HC-Bits: 11
X-Apple-HC-Challenge: 2440d7810cee120173e280f212086aaa
Pragma: no-cache
Transfer-Encoding: Identity
scnt: AAAA-kQ2MjUxMUM4MTcxNjQ1RUM4Mjk0REVCQkNGMjRENDg1MzU0OTU5RDYzRDc0NUY3NDc1RTI4MEU2QjJGNDcwNEE2OTY4NzQwQzlCN0FCNDIyMDkxNTRDNUU0RTUzN0E4NzAyOUVFOTE5MEEyOUY5MDJGRjVCMjg0RDVBNjRBODNCREVBMjg3MUY2NDU5NTQxQkMxQ0UwRDQ0RDlCQjc1MUE2NTg5MDMyRjEyMzdENkZGNEVCNDU5ODc5NDg4ODE5RDk5MDlFM0Q4QkFGQjQyOUYwOTgzQjQ5NkQ0QjU4MDlDREIzQ0NFMEFDNzBBNEMyRnwxAAABg_r1VGMF_44rMfg3Z7A-hRPO2OCijzcBEsjQudm4Z2nNvX-y6uxkQk0XOTx-ABW83DZQ_XVcKNRKZc65I9SqE0q_lLAnhUfQWquygrEB2x0C1GP6sA
Referrer-Policy: origin
X-XSS-Protection: 1; mode=block
Location: /auth
Connection: keep-alive
Date: Fri, 21 Oct 2022 14:17:05 GMT
X-Content-Type-Options: nosniff
Content-Language: en-US-x-lvariant-USA
X-FRAME-OPTIONS: DENY
X-Apple-TwoSV-Trust-Eligible: true
X-BuildVersion: R1
X-Apple-ID-Session-Id: D62511C8171645EC8294DEBBCF24D485354959D63D745F7475E280E6B2F4704A6968740C9B7AB42209154C5E4E537A87029EE9190A29F902FF5B284D5A64A83BDEA2871F6459541BC1CE0D44D9BB751A6589032F1237D6FF4EB459879488819D9909E3D8BAFB429F0983B496D4B5809CDB3CCE0AC70A4C2F
Server: Apple
Set-Cookie: dslang=US-EN; Domain=apple.com; Path=/; Secure; HttpOnly, site=USA; Domain=apple.com; Path=/; Secure; HttpOnly, aasp=D62511C8171645EC8294DEBBCF24D485354959D63D745F7475E280E6B2F4704A6968740C9B7AB42209154C5E4E537A87029EE9190A29F902FF5B284D5A64A83BDEA2871F6459541BC1CE0D44D9BB751A6589032F1237D6FF4EB459879488819D9909E3D8BAFB429F0983B496D4B5809CDB3CCE0AC70A4C2F; Domain=idmsa.apple.com; Path=/; Secure; HttpOnly
Content-Encoding: gzip
X-Apple-I-Request-ID: 0a408192-514b-11ed-9d41-1b475691bc1f
Content-Security-Policy: default-src 'self' ; child-src blob: ; connect-src 'self' https://webcourier.sandbox.push.apple.com https://xp-qa.apple.com ; font-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ; frame-src 'self' https://appleid.apple.com https://gsa.apple.com ; img-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://*.mzstatic.com data: https://*.apple.com ; media-src data: ; object-src 'none' ; script-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ; style-src 'unsafe-inline' 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ;
Expires: Thu, 01 Jan 1970 00:00:00 GMT

{
  "authType" : "hsa2"
}

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - -  END - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] ⚠️ I could not load session (this is normal the first time you authenticate)
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] ⚠️ I could not load cookies (this is normal the first time you authenticate)
2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - - OUTGOING - - - - - - - - - - 

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] https://idmsa.apple.com/appleauth/auth 


GET /appleauth/auth? HTTP/1.1 

HOST: idmsa.apple.com
Content-Type: application/json
User-Agent: curl/7.79.1
X-Apple-ID-Session-Id: D62511C8171645EC8294DEBBCF24D485354959D63D745F7475E280E6B2F4704A6968740C9B7AB42209154C5E4E537A87029EE9190A29F902FF5B284D5A64A83BDEA2871F6459541BC1CE0D44D9BB751A6589032F1237D6FF4EB459879488819D9909E3D8BAFB429F0983B496D4B5809CDB3CCE0AC70A4C2F
X-Apple-Widget-Key: e0b80c3bf78523bfe80974d320935bfa30add02e1bff88ec2166c6bd5a706c42
X-Requested-With: XMLHttpRequest
Accept: application/json, text/javascript
scnt: AAAA-kQ2MjUxMUM4MTcxNjQ1RUM4Mjk0REVCQkNGMjRENDg1MzU0OTU5RDYzRDc0NUY3NDc1RTI4MEU2QjJGNDcwNEE2OTY4NzQwQzlCN0FCNDIyMDkxNTRDNUU0RTUzN0E4NzAyOUVFOTE5MEEyOUY5MDJGRjVCMjg0RDVBNjRBODNCREVBMjg3MUY2NDU5NTQxQkMxQ0UwRDQ0RDlCQjc1MUE2NTg5MDMyRjEyMzdENkZGNEVCNDU5ODc5NDg4ODE5RDk5MDlFM0Q4QkFGQjQyOUYwOTgzQjQ5NkQ0QjU4MDlDREIzQ0NFMEFDNzBBNEMyRnwxAAABg_r1VGMF_44rMfg3Z7A-hRPO2OCijzcBEsjQudm4Z2nNvX-y6uxkQk0XOTx-ABW83DZQ_XVcKNRKZc65I9SqE0q_lLAnhUfQWquygrEB2x0C1GP6sA

2022-10-21T10:17:05-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - -  END - - - - - - - - - - 

2022-10-21T10:17:06-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - - INCOMMING - - - - - - - - - - 

2022-10-21T10:17:06-0400 debug xcodeinstall : [xcodeinstall] https://idmsa.apple.com/appleauth/auth

HTTP 201 /appleauth/auth?
Host: idmsa.apple.com
X-Apple-AK-Auth-Type: hsa2
Server: Apple
Referrer-Policy: origin
X-Apple-ID-Account-Country: USA
Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache, no-store, no-store
scnt: AAAA-kQ2MjUxMUM4MTcxNjQ1RUM4Mjk0REVCQkNGMjRENDg1MzU0OTU5RDYzRDc0NUY3NDc1RTI4MEU2QjJGNDcwNEE2OTY4NzQwQzlCN0FCNDIyMDkxNTRDNUU0RTUzN0E4NzAyOUVFOTE5MEEyOUY5MDJGRjVCMjg0RDVBNjRBODNCREVBMjg3MUY2NDU5NTQxQkMxQ0UwRDQ0RDlCQjc1MUE2NTg5MDMyRjEyMzdENkZGNEVCNDU5ODc5NDg4ODE5RDk5MDlFM0Q4QkFGQjQyOUYwOTgzQjQ5NkQ0QjU4MDlDREIzQ0NFMEFDNzBBNEMyRnwyAAABg_r1VQKYoDwsWuBCKeYAKWmI-Y3-boGY8pYP9LYesUlOg7w5keNe8m_n5pMdABW82evI3XOxTACTxhJ8jGknDxyHZzfckGtfKCozR4Q2Xv1kLHOYqA
Connection: keep-alive
Content-Language: en-US-x-lvariant-USA
Content-Encoding: gzip
X-Content-Type-Options: nosniff
Content-Security-Policy: default-src 'self' ; child-src blob: ; connect-src 'self' https://webcourier.sandbox.push.apple.com https://xp-qa.apple.com ; font-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ; frame-src 'self' https://appleid.apple.com https://gsa.apple.com ; img-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://*.mzstatic.com data: https://*.apple.com ; media-src data: ; object-src 'none' ; script-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ; style-src 'unsafe-inline' 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ;
Vary: accept-encoding
X-Apple-ID-Session-Id: D62511C8171645EC8294DEBBCF24D485354959D63D745F7475E280E6B2F4704A6968740C9B7AB42209154C5E4E537A87029EE9190A29F902FF5B284D5A64A83BDEA2871F6459541BC1CE0D44D9BB751A6589032F1237D6FF4EB459879488819D9909E3D8BAFB429F0983B496D4B5809CDB3CCE0AC70A4C2F
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Apple-Auth-Attributes: IFAOU1Mie9irdXMFdnQAFbzZ/FNUBw==
X-BuildVersion: R1
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Set-Cookie: dslang=US-EN; Domain=apple.com; Path=/; Secure; HttpOnly, site=USA; Domain=apple.com; Path=/; Secure; HttpOnly, dslang=US-EN; Domain=apple.com; Path=/; Secure; HttpOnly, site=USA; Domain=apple.com; Path=/; Secure; HttpOnly, crsc=TTtnOUKkrHGuzd6TRdJqKe9yhNOdm1h4LGpcv7gmAYkMzOE9ZFSoBL8akftiMgmXrFYkh20pH7Xfp51P6wAVvNn8SH2o; Max-Age=900000; Expires=Tue, 01-Nov-2022 00:17:05 GMT; Domain=idmsa.apple.com; Path=/; Secure; HttpOnly
X-FRAME-OPTIONS: DENY
X-XSS-Protection: 1; mode=block
Transfer-Encoding: Identity
Date: Fri, 21 Oct 2022 14:17:05 GMT
X-Apple-I-Request-ID: 0a567acb-514b-11ed-b14b-37c0199655d3

{
  "trustedPhoneNumbers" : [ {
    "numberWithDialCode" : "+1 (•••) •••-••54",
    "pushMode" : "sms",
    "obfuscatedNumber" : "(•••) •••-••54",
    "lastTwoDigits" : "54",
    "id" : 1
  } ],
  "phoneNumber" : {
    "numberWithDialCode" : "•• •••-•••-••54",
    "pushMode" : "sms",
    "obfuscatedNumber" : "(•••) •••-••54",
    "lastTwoDigits" : "54",
    "id" : 1
  },
  "securityCode" : {
    "length" : 6,
    "tooManyCodesSent" : false,
    "tooManyCodesValidated" : false,
    "securityCodeLocked" : false,
    "securityCodeCooldown" : false
  },
  "mode" : "sms",
  "type" : "verification",
  "authenticationType" : "hsa2",
  "recoveryUrl" : "https://iforgot.apple.com/phone/add?prs_account_nm=dsx%40amazon.com&autoSubmitAccount=true&appId=142",
  "cantUsePhoneNumberUrl" : "https://iforgot.apple.com/iforgot/phone/add?context=cantuse&prs_account_nm=dsx%40amazon.com&autoSubmitAccount=true&appId=142",
  "recoveryWebUrl" : "https://iforgot.apple.com/password/verify/appleid?prs_account_nm=dsx%40amazon.com&autoSubmitAccount=true&appId=142",
  "repairPhoneNumberUrl" : "https://gsa.apple.com/appleid/account/manage/repair/verify/phone",
  "repairPhoneNumberWebUrl" : "https://appleid.apple.com/widget/account/repair?#!repair",
  "noTrustedDevices" : true,
  "aboutTwoFactorAuthenticationUrl" : "https://support.apple.com/kb/HT204921",
  "autoVerified" : false,
  "showAutoVerificationUI" : false,
  "supportsCustodianRecovery" : false,
  "hideSendSMSCodeOption" : false,
  "supervisedChangePasswordFlow" : false,
  "trustedPhoneNumber" : {
    "numberWithDialCode" : "+1 (•••) •••-••54",
    "pushMode" : "sms",
    "obfuscatedNumber" : "(•••) •••-••54",
    "lastTwoDigits" : "54",
    "id" : 1
  },
  "supportsRecovery" : true,
  "hsa2Account" : true,
  "restrictedAccount" : false,
  "managedAccount" : false
}

2022-10-21T10:17:06-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - -  END - - - - - - - - - - 

🔐 Two factors authentication is enabled, enter your 2FA code: 023023
2022-10-21T10:17:15-0400 debug xcodeinstall : [xcodeinstall] ⚠️ I could not load session (this is normal the first time you authenticate)
2022-10-21T10:17:15-0400 debug xcodeinstall : [xcodeinstall] ⚠️ I could not load cookies (this is normal the first time you authenticate)
2022-10-21T10:17:15-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - - OUTGOING - - - - - - - - - - 

2022-10-21T10:17:15-0400 debug xcodeinstall : [xcodeinstall] https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode 


POST /appleauth/auth/verify/trusteddevice/securitycode? HTTP/1.1 

HOST: idmsa.apple.com
Accept: application/json, text/javascript
X-Apple-ID-Session-Id: D62511C8171645EC8294DEBBCF24D485354959D63D745F7475E280E6B2F4704A6968740C9B7AB42209154C5E4E537A87029EE9190A29F902FF5B284D5A64A83BDEA2871F6459541BC1CE0D44D9BB751A6589032F1237D6FF4EB459879488819D9909E3D8BAFB429F0983B496D4B5809CDB3CCE0AC70A4C2F,D62511C8171645EC8294DEBBCF24D485354959D63D745F7475E280E6B2F4704A6968740C9B7AB42209154C5E4E537A87029EE9190A29F902FF5B284D5A64A83BDEA2871F6459541BC1CE0D44D9BB751A6589032F1237D6FF4EB459879488819D9909E3D8BAFB429F0983B496D4B5809CDB3CCE0AC70A4C2F
X-Apple-Widget-Key: e0b80c3bf78523bfe80974d320935bfa30add02e1bff88ec2166c6bd5a706c42
X-Requested-With: XMLHttpRequest
User-Agent: curl/7.79.1
scnt: AAAA-kQ2MjUxMUM4MTcxNjQ1RUM4Mjk0REVCQkNGMjRENDg1MzU0OTU5RDYzRDc0NUY3NDc1RTI4MEU2QjJGNDcwNEE2OTY4NzQwQzlCN0FCNDIyMDkxNTRDNUU0RTUzN0E4NzAyOUVFOTE5MEEyOUY5MDJGRjVCMjg0RDVBNjRBODNCREVBMjg3MUY2NDU5NTQxQkMxQ0UwRDQ0RDlCQjc1MUE2NTg5MDMyRjEyMzdENkZGNEVCNDU5ODc5NDg4ODE5RDk5MDlFM0Q4QkFGQjQyOUYwOTgzQjQ5NkQ0QjU4MDlDREIzQ0NFMEFDNzBBNEMyRnwxAAABg_r1VGMF_44rMfg3Z7A-hRPO2OCijzcBEsjQudm4Z2nNvX-y6uxkQk0XOTx-ABW83DZQ_XVcKNRKZc65I9SqE0q_lLAnhUfQWquygrEB2x0C1GP6sA
Content-Type: application/json

 {"securityCode":{"code":"023023"}}
2022-10-21T10:17:15-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - -  END - - - - - - - - - - 

2022-10-21T10:17:15-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - - INCOMMING - - - - - - - - - - 

2022-10-21T10:17:15-0400 debug xcodeinstall : [xcodeinstall] https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode

HTTP 400 /appleauth/auth/verify/trusteddevice/securitycode?
Host: idmsa.apple.com
X-Apple-I-Request-ID: 1056e2d2-514b-11ed-90e4-df5e8989abaf
Content-Type: application/json;charset=UTF-8
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Vary: accept-encoding
Content-Language: en-US-x-lvariant-USA
X-BuildVersion: R1
X-Content-Type-Options: nosniff
X-FRAME-OPTIONS: DENY
Pragma: no-cache
Content-Encoding: gzip
Content-Security-Policy: default-src 'self' ; child-src blob: ; connect-src 'self' https://webcourier.sandbox.push.apple.com https://xp-qa.apple.com ; font-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ; frame-src 'self' https://appleid.apple.com https://gsa.apple.com ; img-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://*.mzstatic.com data: https://*.apple.com ; media-src data: ; object-src 'none' ; script-src 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ; style-src 'unsafe-inline' 'self' https://www.apple.com https://appleid.cdn-apple.com https://idmsa.apple.com https://gsa.apple.com https://idmsa.apple.com.cn https://signin.apple.com ;
Date: Fri, 21 Oct 2022 14:17:15 GMT
Server: Apple
Transfer-Encoding: Identity
Connection: keep-alive
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-XSS-Protection: 1; mode=block
Referrer-Policy: origin
X-Apple-I-Ercd: -21669
scnt: AAAA-kQ2MjUxMUM4MTcxNjQ1RUM4Mjk0REVCQkNGMjRENDg1MzU0OTU5RDYzRDc0NUY3NDc1RTI4MEU2QjJGNDcwNEE2OTY4NzQwQzlCN0FCNDIyMDkxNTRDNUU0RTUzN0E4NzAyOUVFOTE5MEEyOUY5MDJGRjVCMjg0RDVBNjRBODNCREVBMjg3MUY2NDU5NTQxQkMxQ0UwRDQ0RDlCQjc1MUE2NTg5MDMyRjEyMzdENkZGNEVCNDU5ODc5NDg4ODE5RDk5MDlFM0Q4QkFGQjQyOUYwOTgzQjQ5NkQ0QjU4MDlDREIzQ0NFMEFDNzBBNEMyRnwzAAABg_r1fFnUHlRwFN56aTvL-jxITwfXEPuGZEXYr6ZLe3CpCnZoVqB6THnpuQymAAMF3CAnEZHurIERTZwrdwvAWy9NTZqZz75fcF_kHP7yo3Jrc5K8TQ
Cache-Control: no-cache, no-store, no-store
Set-Cookie: dslang=US-EN; Domain=apple.com; Path=/; Secure; HttpOnly, site=USA; Domain=apple.com; Path=/; Secure; HttpOnly

{
  "service_errors" : [ {
    "code" : "-21669",
    "title" : "Incorrect Verification Code",
    "message" : "Incorrect verification code.",
    "suppressDismissal" : false
  } ],
  "hasError" : true
}

2022-10-21T10:17:15-0400 debug xcodeinstall : [xcodeinstall] 
 - - - - - - - - - -  END - - - - - - - - - - 

Error: invalidPinCode

Error: The following formula cannot be installed from bottle and must be built from source.

Describe the bug
Following the README on installing the tool, I get the following error:

(base)  @094459  ~  brew install xcodeinstall
==> Downloading https://github.com/sebsto/xcodeinstall/archive/refs/tags/v0.1.ta
==> Downloading from https://codeload.github.com/sebsto/xcodeinstall/tar.gz/refs
                                                  #    #     #=O=#
==> Installing xcodeinstall from sebsto/macos
Error: The following formula cannot be installed from bottle and must be
built from source.
  xcodeinstall
Install the Command Line Tools:
  xcode-select --install

To Reproduce
Steps to reproduce the behavior:

brew install xcodeinstall

Screenshots

(base)  @094459  ~  brew install xcodeinstall
==> Downloading https://github.com/sebsto/xcodeinstall/archive/refs/tags/v0.1.ta
==> Downloading from https://codeload.github.com/sebsto/xcodeinstall/tar.gz/refs
                                                  #    #     #=O=#
==> Installing xcodeinstall from sebsto/macos
Error: The following formula cannot be installed from bottle and must be
built from source.
  xcodeinstall
Install the Command Line Tools:
  xcode-select --install

Desktop (please complete the following information):

  • OS: Monteray 12.5.1
  • xcodeinstall version 0.1

Fetch default region in ~/.aws/config

Is your feature request related to a problem? Please describe.
I am frustrated to enter the name of the region with the -s parameter

Describe the solution you'd like
I would like xcodeinstall to fetch the default region from [default] profile in ~/.aws/config if it exists

Describe alternatives you've considered
n/a

Additional context
n/a

Download XCode without authentication

Is your feature request related to a problem? Please describe.
It is now possible to download Xcode without authentication
See https://macops.ca/xcode-14-new-platforms-packaging-format/

curl -v "https://developerservices2.apple.com/services/download?path=/Developer_Tools/Xcode_14.0.1/Xcode_14.0.1.xip"
< HTTP/1.1 200 OK
< Server: Apple
< Date: Thu, 13 Oct 2022 05:24:27 GMT
< Content-Length: 0
< Connection: keep-alive
< Set-Cookie: ADCDownloadAuth=bDHjRR3cAxlCeJgSzPhJ%2B%2FByRrwhWtFpeZ9AMDT0h1abSQBBn5wvLK%2ByJwwxld%2BODoDoVB%2B8yszA%0D%0AV%2Bivz8XWhNcM9Gttbp6MMI0UEkmr3wAJVbGgnv2ZEfoezZQgozj5LiTR7wFa%2FNmMI0oaSTqeRjKt%0D%0AkXVJ%2BJgqd7yZfuImBRtGcV9c%0D%0A;Version=1;Comment=;Domain=apple.com;Path=/;Max-Age=108000;HttpOnly;Expires=Thu, 13 Oct 2022 05:24:27 GMT


curl -vL0 --cookie ADCDownloadAuth=ILyY%2FDe2y2gp7a6PONIbwDHrBK3WAWTyiE6H7hEjyHCrlqHNnes4CBSPob0S35%2Fe1gV4TvlISZLn%0D%0AY9%2FlkRd9m2%2BInEISwAo5Qmr1hzHVyWUJ6cawQzJbar7aG%2FlYjC%2F%2FCDUjHzhYLytb8eM8rmG53Hlf%0D%0AeMcVnDdbbjzK5PAz9mt2%2BKZg%0D%0A --output Xcode_14.0.1.xip "https://download.developer.apple.com/Developer_Tools/Xcode_14.1_beta_3/Xcode_14.1_beta_3.xip"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.