


Requires a developer account to have been added in Xcode’s Accounts preference pane or an App Store Connect authentication key to be specified via the -authenticationKeyPath, -authenticationKeyID, and -authenticationKeyIssuerID parameters.īecause I am building for iOS I provided -sdk iphoneos and if you want to see what other sdks are available or if you want to build your app for another platform you can use: For manually signed targets, xcodebuild will download missing or updated provisioning profiles.

For automatically signed targets, xcodebuild will create and update profiles, app IDs, and certificates. This option is not very reliable and in most of my apps I’ve downloaded and imported manually provisioning profiles or certificates to Keychain.ĭocumentation for allowProvisioningUpdates:Īllow xcodebuild to communicate with the Apple Developer website. In the example above I included the flag -allowProvisioningUpdates and this will generate or modify provisioning profiles if you use Automatic signing. Touch /tmp/.-progress Įasy peasy ☺️ I also made a gist with this, which you can download here.Xcodebuild archive -scheme -sdk iphoneos -allowProvisioningUpdates -archivePath. In this AskDifferent answer a solution without GUI is proposed, and here you can find my spin on it: #!/bin/bash # See echo "Checking Xcode CLI tools" # Only run if the tools are not installed yet # To check that try to print the SDK path That is not optimal when trying to setup a VM in an automated way.

The canonical way to do it is to install Xcode itself, but that means downloading a couple of GB of app from the store, which might take time.Īnother option is to open a Terminal and type xcode-select -install.īoth the options above have a flaw: they require a GUI. If you are in the business of setting up new development machines or virtual machines you probably know that to do almost anything you need to have the Xcode Command Line Tools.īeing something that only devs need Apple doesn't ship them with OS X, as far as Yosemite at least, so you need to install them yourself.
