[ 
https://issues.jenkins-ci.org/browse/JENKINS-12800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=163006#comment-163006
 ] 

Markos Charatzas edited comment on JENKINS-12800 at 5/21/12 3:38 PM:
---------------------------------------------------------------------

-@sweidauer as a workaround, in XCode, under your project "Build Settings", 
"Code Signing Identity":-

-1. Click on the configuration that lists your "iPhone Distribution" 
certificate.-
-2. Select "Other..."-
-3. Note the unique identifier for the certificate. Should be a long hex 
number.-
-4. Enter that in the custom xcodebuild arguments as 
CODE_SIGN_IDENTITY=ΧΧΧΧΧΧΧΧ-ΧΧΧΧ-ΧΧΧΧ-ΧΧΧΧ-ΧΧΧΧΧΧΧΧΧΧΧΧ-

Turns out this isn't the correct identity for the certificate as [it's not the 
SHA-1 
key|https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/codesign.1.html].

{quote}
If identity consists of exactly forty hexadecimal digits, it is instead 
interpreted as the SHA-1 hash
     of the certificate part of the desired identity.  In this case, the 
identity's subject name is not con-
     sidered.
{quote}
 
You can find the identity of your certificate by using 

{code}
security find-identity -p codesigning -v
{code}

However, even specifying this as the CODE_SIGN_IDENTITY doesn't seem to work as 
'xcodebuild' complains with the following error.

{quote}
[BEROR]Code Sign error: The identity 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' 
doesn't match any valid, non-expired certificate/private key pair in the 
default keychain
{quote}

The only suggestion I have as a workaround is to search and replace the 
certificate in the project file as part of the build.

In Jenkins, under 'Build', 'Execute Shell', 'Command'

{code}
#!/bin/sh
# Changing any signing certificate from an "iPhone Developer" to "iPhone 
Distribution"
sed -i "" 's/CODE_SIGN_IDENTITY = \"iPhone Developer\";/CODE_SIGN_IDENTITY = 
\"iPhone Distribution\";/g' Foo.xcodeproj/project.pbxproj
sed -i "" 's/\"CODE_SIGN_IDENTITY\[sdk=iphoneos\*\]\" = \"iPhone 
Developer\";/\"CODE_SIGN_IDENTITY\[sdk=iphoneos\*\]\" = \"iPhone 
Distribution\";/g' Foo.xcodeproj/project.pbxproj
{code}
                
      was (Author: qnoid):
    -@sweidauer as a workaround, in XCode, under your project "Build Settings", 
"Code Signing Identity":-

-1. Click on the configuration that lists your "iPhone Distribution" 
certificate.-
-2. Select "Other..."-
-3. Note the unique identifier for the certificate. Should be a long hex 
number.-
-4. Enter that in the custom xcodebuild arguments as 
CODE_SIGN_IDENTITY=ΧΧΧΧΧΧΧΧ-ΧΧΧΧ-ΧΧΧΧ-ΧΧΧΧ-ΧΧΧΧΧΧΧΧΧΧΧΧ-

Turns out this isn't the correct identity for the certificate as [it's not the 
SHA-1 
key|https://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/codesign.1.html].

{quote}
If identity consists of exactly forty hexadecimal digits, it is instead 
interpreted as the SHA-1 hash
     of the certificate part of the desired identity.  In this case, the 
identity's subject name is not con-
     sidered.
{quote}
 
You can find the identity of your certificate by using 

{code}
security find-identity -p codesigning -v
{code}

However, even specifying this as the CODE_SIGN_IDENTITY doesn't seem to work as 
'xcodebuild' complains with the following error.

{quote}
[BEROR]Code Sign error: The identity 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' 
doesn't match any valid, non-expired certificate/private key pair in the 
default keychain
{quote}
                  
> Can't add xcodebuild parameters including whitespace
> ----------------------------------------------------
>
>                 Key: JENKINS-12800
>                 URL: https://issues.jenkins-ci.org/browse/JENKINS-12800
>             Project: Jenkins
>          Issue Type: Bug
>          Components: xcode
>    Affects Versions: current
>            Reporter: Sven Weidauer
>
> I am trying to pass the parameter 'CODE_SIGN_IDENTITY="iPhone Distribution"' 
> to xcodebuild via the new 'custom xcodebuild arguments' field. But no matter 
> how I quote this it always gets split into two paramters at the whitespace 
> which makes the build fail.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.jenkins-ci.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to