codesign "The operation was cancelled by the user"

Bob Bobbio picture Bob Bobbio · Oct 31, 2010 · Viewed 9.8k times · Source

For some reason, whenever I try to codesign in xcode, I am getting this error

(path to app): The operation was cancelled by the user. Command /usr/bin/codesign failed with exit code 1

Answer

freespace picture freespace · Nov 9, 2010

I had this error after I changed my login keychain password, and my developer certificate was in this keychain.

I restarted and unlocked the keychain again and all was well.