Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CODE_SIGN_IDENTITY parameter for xcodebuild (Xcode 4)

I'm using xcodebuild utility shipped with Xcode 3 to automate my builds under Hudson. The command looks like it follows:

xcodebuild -project Project.xcodeproj -target Target -configuration Release -sdk iphoneos CODE_SIGN_IDENTITY[sdk=iphoneos*]="iPhone Distribution:XXXXXX"

I'm trying to use the same command for Xcode 4 but it seems that xcodebuild just ignores CODE_SIGN_IDENTITY parameter and signs with the provisioning profile which is selected for the target in Xcode.

It's a quite crucial for me since I have to sign build with 3-4 different profiles. It works OK with Xcode 3 but doesn't work with Xcode 4.

Any idea how to solve this problem?

like image 596
Dmytro Avatar asked Feb 13 '12 17:02

Dmytro


Video Answer


1 Answers

A newer xcodebuild now allows settings to be specified. Taken from developer.apple.com:

xcodebuild [-project projectname] [-target targetname ...]
           [-configuration configurationname] [-sdk [sdkfullpath | sdkname]]
           [buildaction ...] [setting=value ...] [-userdefault=value ...]

I also found this resource for explaining the available settings

CODE_SIGN_IDENTITY (Code Signing Identity)
    Description: Identifier. Specifies the name of a code signing identity.
    Example value: iPhone Developer

However, PROVISIONING_PROFILE is missing from the index of available commands.

The command I finally used specified "CODE_SIGN_IDENTITY" & "PROVISIONING_PROFILE" settings.

xcodebuild -sdk <iphoneos> -target <target_name> -configuration <Debug> CODE_SIGN_IDENTITY="iPhone Developer: Mister Smith" PROVISIONING_PROFILE="XXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX"
like image 193
Michelle Avatar answered Dec 11 '22 07:12

Michelle