The problem is that my app bundle works before signing and crashes if I use codesign
and I am absolutely clueless as to how find out the reasons. Can someone push me in the right direction?
I am getting this report. I assume the software starts correctly (yes?), loads libraries without problems (yes?), but then does some check and fails. What could I check to find the reason of the crash?
-------------------------------------Translated Report (Full Report Below)-------------------------------------Process: bla [1386]Path: /Users/USER/Desktop/*/bla.app/Contents/MacOS/blaIdentifier: firma.blaVersion: 1.2.572 (1.2.572)Code Type: X86-64 (Native)Parent Process: launchd [1]User ID: 504Date/Time: 2023-11-13 14:51:17.7531 +0100OS Version: macOS 12.5 (21G72)Report Version: 12Anonymous UUID: 1B6A...Sleep/Wake UUID: 1588...Time Awake Since Boot: 4500 secondsSystem Integrity Protection: enabledCrashed Thread: 0 Dispatch queue: com.apple.main-threadException Type: EXC_CRASH (SIGKILL (Code Signature Invalid))Exception Codes: 0x0000000000000001, 0x0000000000000000Exception Note: EXC_CORPSE_NOTIFYTermination Reason: Namespace CODESIGNING, Code 2 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread...
I've read about signing process and tried few things, namely I can re-sign previous version of the same bundle, exactly like I am doing with the newer and there are no problems. I've compared entitlements, they are identical. The new app bundle uses new framework and has lots of changes in source code, but they both works unsigned and then newer one stops working after signing. Why?
I copy app bundle and run it - works.
Then I sign the file and the app like this:
% codesign --no-strict --force --timestamp --options=runtime --entitlements "bla.entitlements" --sign "Developer ID Application: ..." "bla.app/Contents/MacOS/bla"% codesign ... "bla.app"
Then I verify signing
% codesign --verify --verbose bla.appbla.app: valid on diskbla.app: satisfies its Designated Requirement
And then I start it directly by double clicking or from terminal and it crashes
% ./bla.app/Contents/MacOS/blazsh: killed ./bla.app/Contents/MacOS/bla
What should I do?