I want to use
xcodebuild […] -allowProvisioningUpdates
To build my iOS app and have a provisioning profile automatically generated.
man xcodebuild
says:
Requires a developer account to have been added in Xcode's Accounts preference pane.
This works fine locally. When I run this in my CI server, I see
Code Signing Error: There are no accounts registered with Xcode. Add your developer account to Xcode
Because, of course, I'm not logged in there.
How can I add my developer account to Xcode from a script?
For reference, I'm using CircleCI and fastlane, but would accept any answer that uses only command-line tools.