Thursday, August 9, 2012

Trouble signing Apps for OSX Mountain Lion

If you're building desktop Apps for OSX, chances are you'll need or you're already working on getting them signed with Apple's certificate. Otherwise your users might see this, starting with Mountain Lion:
I just signing few apps and scored new items in my erroropedia:

Error 1: "Error signing data"

$ productsign --sign 'Developer ID Application: YourCompany' from.pkg to.pkg
productsign: signing product with identity "Developer ID Application: YourCompany" from keychain /Users/user/Library/Keychains/login.keychain
Error signing data.
productsign: error: Failed to sign the product.
Reason: keychain is locked for access from SSH. Try
security unlock-keychain -p
You might also need to enable access to certificate private key for all applications:

Error 2: "MyApp.app: object file format unrecognized, invalid, or unsuitable"

One solution that worked for me:
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
but it didn't work for other .app package I was trying.

Error 3: "codesign_allocate: the __LINKEDIT segment does not cover the end of the file (can't be processed) in: MyApp.app/Contents/MacOS/MyApp"

No Idea yet... If you figured this out, let me know. I saw that for the same .app package it showed up on OSX 10.5.8, 10.7, but not on OSX 10.8. So maybe it's a matter of updating XCode/OSX?

2 comments:

  1. Czyżbyś się przekwalifikował na dewelopera MacOSa?

    ReplyDelete
  2. Moje aplikacje od zawsze chodziły na Macu :-)
    Ale zaczynając od Mountain Liona, wszystkie aplikacje desktopowe (te w Javie też) muszą być podpisane certyfikatem od Apple.

    ReplyDelete