3

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?

Thor_Bux
  • 1,137
  • 12
  • 26

2 Answers2

3

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.

Community
  • 1
  • 1
Thor_Bux
  • 1,137
  • 12
  • 26
  • Thanks for sharing the solution @Thor_Bux Just one note: this is not bitrise specific, but macOS Sierra specific. A couple of keychain/signing related things changed in Sierra, which worked (a bit differently) on El Capitan. It's important to note, as on bitrise.io you can select both Sierra and El Capitan stacks. – Viktor Benei Mar 16 '17 at 09:57
  • The reason why I explicitly mentioned Bitrise here is that this issue does not occur on my local Mac which also runs Sierra. Thanks for mentioning that I should include the MacOS version. – Thor_Bux Mar 16 '17 at 21:38
0

I found a solution by signing with the hex id of the certificate instead.

You can find the HEX ID by running: security find-identity -v

Credit Here: -- Segmentation fault: 11 when attempting to codesign .app

D1v3
  • 101
  • 1
  • 11