Search code examples
macoscode-signingcodesignbitrise

MacOS codesign command on Bitrise failure: Segmentation fault: 11


For some reason, I need to run a manual code signing for my macos app on Bitrise. When doing that with the following command:

codesign --deep --force --verify --verbose --sign "Developer ID Application: Name (ID)" "MyApp.app"

It always returned with the error:

line 11:  3043 Segmentation fault: 11

Does anyone know how to fix that?


Solution

  • While looking for possible solutions I came across these two posts:

    Segmentation fault: 11 when attempting to codesign .app

    https://forums.developer.apple.com/thread/65055

    They helped me to find a solution to my issue. The answer marked as correct at the first link states that:

    --timestamp=none
    

    would fix it which was not true for me. But the second answer, as well as the solution mentioned in the second link, contains the correct hint.

    I needed to sign with hex identifier and not with the certificate name.

    You can get the hex identifier for your certificates executing this command:

    security find-identity -p codesigning
    

    Using the hex identifier returned for my certificate this is the command I need to run on Bitrise in order to sign MyApp.app

    codesign --deep --force --verify --verbose -s <<hex identifier>> "MyApp.app"
    

    Be aware that the order of the options is also important. '-s' had to be the last option for me.

    (And remember to include the Bitrise workflow step 'Certificate and profile installer')

    ===Edit===

    I'm talking about MacOS Sierra stack here.