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
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.