I'm using xcodebuild to compile my iPhone app from the command line. Is there a way to pass in some sort of option to set the provisioning profile? There seems to be not very much information about xcodebuild in general.
I'm using xcodebuild to compile my iPhone app from the command line. Is there a way to pass in some sort of option to set the provisioning profile? There seems to be not very much information about xcodebuild in general.
Actually, you should be able to just add it to the XCode command line setting.
xcodebuild [whatever other options you have] PROVISIONING_PROFILE="[Your profile Unique ID here]"
Build Settings from the command line are supposed to override everything, so this should win out over anything defined in the project or target.
It seems from the doc, you can't set the provisioning file BUT you can specify the target:
[-target targetname]
So, if you create a target for each provisioning file, you could select the proper target from the command line.
This would basically accomplish what your asking.
You can create ExportOption.plist file where you'll set all parameters, like: compileBitcode, teamID, certificates and provisioning profiles.
Then go to the project folder in terminal and create archive with command, like :
xcodebuild -quiet -workspace <ProjectName>.xcworkspace -scheme <ProjectScheme> -sdk iphoneos -configuration Release -destination generic/platform=iOS clean archive -archivePath <PathForArchive>/<ProjectName>.xcarchive
Next put ExportOption.plist to current folder (PathForArchive) and run:
xcodebuild -quiet -exportArchive -archivePath <ProjectName>.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath <PathForExport>
And you'll have an .ipa in folder with setting from ExportOptions.plist