Codesign commands no longer working

I have a series of codesign commands that I would run regularly to sign my app. They always worked fine, until I recently upgraded my Mac OS to Monterey and XCode to 13.3.1. Now the same syntax just results in codesign's usage message.

Here's one of the commands that fails:

codesign --deep --force --verify --verbose --timestamp --options runtime --entitlements "example.entitlements" --sign "Developer ID Application: Company Name (XXXXXXXXXX)"

I tried variations also, to no avail, such as this:

codesign -s "Developer ID Application: Company Name (XXXXXXXXXX)" --options runtime --timestamp --force --deep --entitlements "example.entitlements"

Any idea what I'm doing wrong, and why it stopped working after upgrading? Thanks.

The codesign tool is built in to macOS, so your Xcode version doesn’t matter.

Your first command seems like nonsense to me. It’s supplying both --verify and --sign, which is contradictory.

Your second command seems reasonable. I tried this here in my office and it worked as expected:

% sw_vers
ProductName:	macOS
ProductVersion:	12.3.1
BuildVersion:	21E258
% codesign -s "Developer ID Application" --options runtime --timestamp --force --deep --entitlements "example.entitlements" "Test706370.app"
Test706370.app: replacing existing signature

The only thing I changed was:

  • Replaced Developer ID Application: Company Name (XXXXXXXXXX) with the shortcut Developer ID Application.

  • Added Test706370.app to tell it what to sign.

ps Don’t sign code with --deep. For an explanation as to why not, see --deep Considered Harmful. However, that’s not the cause of this issue.

pps For detailed advice on how to sign Mac products from the command line, see:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Codesign commands no longer working
 
 
Q