Signing a fresh Xcode project for a personal team from the CLI
Xcode's default bundle ID from the new-project template (e.g. com.test.Test-Project) may already be registered by another team. In that case xcodebuild -allowProvisioningUpdates fails with "Failed Registering Bundle Identifier ... cannot be registered to your development team"; change PRODUCT_BUNDLE_IDENTIFIER to a unique reverse-DNS value. If the project has no team, add DEVELOPMENT_TEAM = <id>; to both build configurations in project.pbxproj. To find team IDs without the GUI, run defaults read com.apple.dt.Xcode IDEProvisioningTeamByIdentifier, which lists teamID, teamName and isFreeProvisioningTeam. Build with -destination 'id=<udid>' (get the UDID from xcodebuild -showdestinations), then install with xcrun devicectl device install app --device <coredevice-id> App.app.