Xcode Server Sigining Product

I am not being able to sign my Product. It stucks in step 6 when running my continuous integration. Actually there is also another weird thing happenning.

In OS X Server Xcode preferences pane I added my developer account to enable Xcode Server sign my .ipa file. But in OS X Server Logs I saw something like this



Jun 15 10:26:05 blabla.com.tr xcscontrol[961]: DeveloperPortal: Completed request 8331BF8B-EA0B-4C99-987F-8F3E9ECCED62 (failure): {

"DTDK_Platform" = ios;

creationTimestamp = "2015-06-15T07:23:44Z";

httpCode = 200;

protocolVersion = QH65B2;

requestId = "8331BF8B-EA0B-4C99-987F-8F3E9ECCED62";

requestUrl = "https://developerservices1.apple.com/services/QH65B2/ios/downloadTeamProvisioningProfile.action";

responseId = "5544ef83-0af3-441f-acf7-ea931331f3a5";

resultCode = 3170;

resultString = "No team member found for teamId 'TEAMID_XXXX' and teamClientUid 'CLIENTUID_***'";

teamId = TEAMID_XXXX;

userLocale = "en_US";

userString = "Unable to find a team with the given Team ID '***.***.***' to which you belong. Please contact Apple Developer Program Support.\\nhttps://developer.apple.com/support";

}



Btw I have also added my developer certificate (both for release and developer) to my login and system keychain. (I assume that Xcode Server fetch certificates from system keychain). And I can see all of my provisioning profiles in this directory /Library/Developer/XcodeServer/ProvisioningProfiles also.



Another issue is that after Integration has finished I have got error message like that;



Bot Issue: error. Build Service Error.

Issue: Terminated xcodebuild since it produced no output for too long..

Description: Terminated xcodebuild since it produced no output for too long..



On the integration logs I saw error message like that

/usr/bin/codesign --force --sign XXXXXXXX --entitlements /PATH/TO/SingleApplication.app.xcent /PATH/TO/SingleApplication.app

** BUILD INTERRUPTED **



What else am i missing?

Replies

I think you should try removing your team from Xcode Server and do everything manually.

Also, do not use automatic provisioning profile selection in Build Settings!!!

Add the exact matching provisioning profile to your Build Settings.


Then it will work

I'm experiencing a similar hang when building in Xcode server. For me it hangs in step 4 of 9 "Signing product". I'm running the beta 2 of Xcode 7 and Server 5.1 with Xcode server on the same MBP box which is running 10.10.4 release. The raw log file shows a similar problem to what you are reporting after the hang:


CodeSign /Library/Developer/XcodeServer/Integrations/Caches/56b1bc2eb30515c3f99753f43121a783/DerivedData/Build/Products/Debug-iphoneos/SpotfireFramework.framework

cd /Library/Developer/XcodeServer/Integrations/Caches/56b1bc2eb30515c3f99753f43121a783/Source/Spotfire/SpotfireFramework

export CODESIGN_ALLOCATE=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"


Signing Identity: "iPhone Distribution: TIBCO Software, Inc."

Provisioning Profile: "Spotfire Mobile In House"

(xxxxxxxxxx)

/usr/bin/codesign --force --sign xxxxxxxxxxxxx /Library/Developer/XcodeServer/Integrations/Caches/56b1bc2eb30515c3f99753f43121a783/DerivedData/Build/Products/Debug-iphoneos/SpotfireFramework.framework

Sampling process 22357 for 10 seconds with 1 millisecond of run time between samples

Sampling completed, processing symbols...

Sample analysis of process 22357 written to file /Library/Developer/XcodeServer/Integrations/Integration-11a8d3d5b73a6372f99fb305e4019bae/xcodebuild.sample

sample[25066]: sample cannot find any existing process you have access to which has a name like 'Interface Builder Cocoa Touch Tool'; try running with `sudo`.

sample[25067]: sample cannot find any existing process you have access to which has a name like 'ibtool'; try running with `sudo`.

sample[25068]: sample cannot find any existing process you have access to which has a name like 'ibtoold'; try running with `sudo`.

** BUILD INTERRUPTED **


----

It just hangs for 5 minutes, then kills the bot because of no activity.


This same project builds perfectly with the same scheme on the same box in Xcode 7 beta 2 with no hangs - it just hangs and fails under Xcode server.


I tried Fab1n's suggestions - removing my team from Xcode server, then adding it back. I made sure that all my provisioning profiles in

/Users/${USER}/Library/MobileDevice/Provisioning Profiles/
are copied to /Library/Developer/XcodeServer/ProvisioningProfiles. I also made sure that the certificates in login are also properly installed in System keychain. And I made sure that the build settings of the scheme do not use 'Automatic' for the code signing. Each field is hooked up to the proper certificate and the provisioning profile is hooked up explicitly.

I just installed beta 3 of both Xcode 7 and Server 5. The same hang occurs - no change in behavior:


...

CodeSign /Library/Developer/XcodeServer/Integrations/Caches/56b1bc2eb30515c3f99753f43121a783/DerivedData/Build/Products/Debug-iphoneos/SpotfireFramework.framework

cd /Library/Developer/XcodeServer/Integrations/Caches/56b1bc2eb30515c3f99753f43121a783/Source/Spotfire/SpotfireFramework

export CODESIGN_ALLOCATE=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate

export PATH="/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/Applications/Xcode-beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity: "iPhone Distribution: TIBCO Software, Inc."

Provisioning Profile: "Spotfire Mobile In House"

(0f82676b-7dd8-4a63-9e8f-da7a79388a21)

/usr/bin/codesign --force --sign E000B219A7751C3EA5A4837FFD4B5CF312F4F4AF /Library/Developer/XcodeServer/Integrations/Caches/56b1bc2eb30515c3f99753f43121a783/DerivedData/Build/Products/Debug-iphoneos/SpotfireFramework.framework

Sampling process 17549 for 10 seconds with 1 millisecond of run time between samples

Sampling completed, processing symbols...

Sample analysis of process 17549 written to file /Library/Developer/XcodeServer/Integrations/Integration-98b9cb160fb1b2ee04184d4d93008afe/xcodebuild.sample

sample[20009]: sample cannot find any existing process you have access to which has a name like 'Interface Builder Cocoa Touch Tool'; try running with `sudo`.

sample[20010]: sample cannot find any existing process you have access to which has a name like 'ibtool'; try running with `sudo`.

sample[20011]: sample cannot find any existing process you have access to which has a name like 'ibtoold'; try running with `sudo`.

** BUILD INTERRUPTED **

Problem persists in Xcode 7 beta 4 and Server 5.0 beta 4.

The problem seems to happen for me when the project targets of both the framework and the app have specific provisioning profile and signing identities specified. If instead you set up each project (framework and app) to use auto provisioning (following steps outlined in "Setting up Xcode to automatically manage your provisioning profiles" (https://developer.apple.com/library/mac/qa/qa1814/_index.html) to setup the project and targets to use automatic provisioning), the problem disappears.

Try this:


- open Keychain Access app

- right click on the private key of proper certificate in system keychain and click on 'get info'

- go to Access Control tab

- enable 'allow all applications to access this item'

- save changes


Then, start integration again.

When I do this on the System Keychain, access gets set right back to "Confirm", next time I check it.

What was happening was that even though I entered the admin username and password, the Xcode Server user also put up alerts when this changed. I had to switch users and enter the username and password for about 20 change access requests. Then, the bots handled code signing without a problem.


Freaking Apple.

Instead of checking Allow all applications to access this item, which is categorically unsafe, you can instead click the + button in the lower-left corner, and then use the dialog to find the codesign application, which is much less open to potential abuse.