I have Xcode9 installed on my OSX machine. I am using xcodebuild command line to sign my app which of course uses the latest Xcode9 based commaline tools.
Following is the way I am trying to sign my app:
xcodebuild -project "MyProject.xcodeproj" -scheme "MyProject" -sdk "iphoneos" -configuration Release PROVISIONING_PROFILE="MyProject_ProvisioningProfile" DEVELOPEMENT_TEAM="MY_TEAM_ID"
But, it gives the following error.
Code Signing Error: Provisioning profile "profile_name" is Xcode managed, but signing settings require a manually managed profile.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.0'
But when I build using Xcode9 UI IDE selecting "Automatic signing", it works. I want to replicate the same using xcodebuild command line.
I read that with Xcode 9 installed, we can do automatic signing from command line just like Xcode UI does.
Question:
How should I modify xcodebuild command to do automatic signing just the way it is done on Xcode UI based tool?
I understand from official documentation that one should prefer automatic signing. But how to do this with xcodebuild command line
Looking at this discussion, I tried switching it on the project.pbxproj file using sed.
sed -i '' 's/ProvisioningStyle = Manual;/ProvisioningStyle = Automatic;/' <ProjectName>.xcodeproj/project.pbxproj
But that didn't help