scb998
scb998

Reputation: 909

Why am I getting the error "Command /usr/bin/codesign failed with exit code 1" in Xcode 6 on Yosemite?

I'm using Xcode 6.1, OS X Yosemite preview 8, and I'm getting the following error on code signing my app:

Command /usr/bin/codesign failed with exit code 1

Reading on Google, it seems to be linked to expired certificates/provisioning profiles. I deleted all of my certificates & profiles, created a new development certificate & profile, installed both, restarted my Mac, and I’m still getting the same error.

Can anyone shed some light on how to resolve this problem?

Upvotes: 10

Views: 25003

Answers (8)

Another gotcha I noticed is that codesign will fail if run from an ordinary ssh login session. It has to be run on a MacOSX desktop GUI shell window. This catches me every time, so I've added a line to the build script to print a message about running the script on the MacOSX GUI if codesign fails.

Upvotes: 1

Dave Cole
Dave Cole

Reputation: 2765

I had to delete all my developer certificates from Keychain Access first, then use the Preferences -> Accounts -> View Details -> Download All approach to successfully re-sign my code.

Upvotes: 0

Jacob Rose
Jacob Rose

Reputation: 460

There appears to be a bug in XCode (I'm using 7.1.1) with returning to "Signing: None" after having attempted to sign with an expired identity, resulting in this codesign error even after you've apparently removed the bad signing identity.

The project.pbxproj file retains TargetAttributes for the expired identity, and Debug and Release settings both continue to show the following instead of the original empty values:

"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer";

This persists after cmd+alt+shift+K and closing XCode. I fixed it with a git reset (if I hadn't committed before attempting to sign, I'm not sure how I would have found this).

Upvotes: 0

Keith
Keith

Reputation: 141

In my case I was getting this error while trying to build a project I downloaded from Github for my own personal use. I just went to the build settings and told it not to sign the code.

Upvotes: 1

C. Greene
C. Greene

Reputation: 281

as of Xcode 6.3.2, here's what I did. from main project view, click on build settings and in the search bar type in certificate, a code signing tab should pop up, I chose "dont sign code". and it worked

Upvotes: 2

Sarat Patel
Sarat Patel

Reputation: 856

Delete previous provisional profile and add new provisional profile.restart the machine if still its giving an error like above. when your machine shut off then automatically your device asking for permission then select Confirm and run your code....its working.

Upvotes: 0

scb998
scb998

Reputation: 909

So I've managed to fix the issue for my particular case - in the build settings, instead of automatically detecting the certificate & provisioning profile to use, I manually set them - and it works.

Upvotes: 1

LMVogel
LMVogel

Reputation: 779

How about this: Try Xcode -> Preferences -> Accounts -> Choose your account, and then View Details -> Refresh (button on bottom left), Refresh again, restart XCode. Sounds like voodoo but it works for me and my team! (Posting it as answer, because it DOES work, at least sometimes and for some people. Possibly related to the weather ;) )

Upvotes: 35

Related Questions