Codesigning outside of Xcode EXC_CRASH (Code Signature Invalid)

I have been trying to code sign my Omnis Studio application, so I am signing outside of Xcode. Everything signs ok, I tested it as well


When I run a check:

Clients & Profits x64beta.app: valid on disk

Clients & Profits x64beta.app: satisfies its Designated Requirement




Process: CPCloud [3250]
Path: /C&P InstallersRuntimes/*/Clients & Profits x64beta.app/Contents/MacOS/CPCloud
Identifier: com.clientsandprofits.CPCloud
Version: ???
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: CPCloud [3250]
User ID: 501


Date/Time: 2019-11-15 14:36:29.064 -0800
OS Version: Mac OS X 10.14.6 (18G103)
Report Version: 12
Bridge OS Version:3.6 (16P6571)
Anonymous UUID: 8EF04917-BF79-DCF9-6C0C-ECCB2995EDA6



Time Awake Since Boot: 15000 seconds


System Integrity Protection: enabled


Crashed Thread: 0


Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes:0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY


Termination Reason:Namespace CODESIGNING, Code 0x1


kernel messages:


VM Regions Near 0 (cr2):

-->

__TEXT 000000010e422000-000000010ed08000 [ 9112K] r-x/rwx SM=COW


Thread 0 Crashed:

0 0x0000000115013000 _dyld_start + 0


Thread 0 crashed with X86 Thread State (64-bit):

rax: 0x0000000000000000 rbx: 0x0000000000000000 rcx: 0x0000000000000000 rdx: 0x0000000000000000

rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x0000000000000000 rsp: 0x00007ffee17ddb88

r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000

r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000

rip: 0x0000000115013000 rfl: 0x0000000000000200 cr2: 0x0000000000000000


Logical CPU:0
Error Code:0x00000000
Trap Number:0



Binary Images:

0x10e422000 - 0x10ed07fff + (0) <131350F5-58E1-3BAA-ACD9-A82E801ED437>
0x115012000 - 0x11507c70f + (655.1.1) <DFC3C4AF-6F97-3B34-B18D-7DCB23F2A83A>


External Modification Summary:

Calls made by other processes targeting this process:

task_for_pid: 0
thread_create: 0
thread_set_state: 0

Calls made by this process:

task_for_pid: 0
thread_create: 0
thread_set_state: 0

Calls made by all processes on this machine:

task_for_pid: 11065
thread_create: 0
thread_set_state: 0


VM Region Summary:

ReadOnly portion of Libraries: Total=11.9M resident=0K(0%) swapped_out_or_unallocated=11.9M(100%)

Writable regions: Total=9188K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=9188K(100%)


VIRTUAL REGION
REGION TYPE SIZECOUNT (non-coalesced)
=========== ======= =======
STACK GUARD 56.0M 1
Stack 8192K 1
__DATA 1592K 4
__LINKEDIT 2620K 2
__TEXT 9540K 2
shared memory 8K 2
=========== ======= =======
TOTAL 77.4M12


Model: MacBookPro15,1, BootROM 220.270.99.0.0 (iBridge: 16.16.6571.0.0,0), 8 processors, Intel Core i9, 2.3 GHz, 16 GB, SMC

Graphics: kHW_IntelUHDGraphics630Item, Intel UHD Graphics 630, spdisplays_builtin

Graphics: kHW_AMDRadeonPro560XItem, Radeon Pro 560X, spdisplays_pcie_device, 4 GB

Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2400 MHz, SK Hynix, -

Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2400 MHz, SK Hynix, -

AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x7BF), wl0: Mar 28 2019 19:17:52 version 9.137.9.0.32.6.34 FWID 01-36f56c94

Bluetooth: Version 6.0.14d3, 3 services, 27 devices, 1 incoming serial ports

Network Service: USB 10/100/1000 LAN, Ethernet, en5

Network Service: USB 10/100/1000 LAN 2, Ethernet, en9

Network Service: Wi-Fi 2, AirPort, en0

USB Device: USB 3.1 Bus

USB Device: USB2.0 Hub

USB Device: USB2.0 Hub

USB Device: USB-C multiport device

USB Device: USB PnP Audio Device

USB Device: USB2.0 Hub

USB Device: Keyboard Hub

USB Device: Apple Optical USB Mouse

USB Device: Apple Keyboard

USB Device: USB 2.0 BILLBOARD

USB Device: USB3.0 Hub

USB Device: USB3.0 Hub

USB Device: USB 10/100/1000 LAN

USB Device: NS1081

USB Device: External USB 3.0

USB Device: iBridge Bus

USB Device: iBridge DFR brightness

USB Device: iBridge Display

USB Device: Apple Internal Keyboard / Trackpad

USB Device: Headset

USB Device: iBridge ALS

USB Device: iBridge FaceTime HD Camera (Built-in)

USB Device: iBridge

Thunderbolt Bus: MacBook Pro, Apple Inc., 42.1

Thunderbolt Bus: MacBook Pro, Apple Inc., 42.1

Replies

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

There are a bunch of potential issues here but the most common ones are:

  • Signing identity problems — For example, an app signed with a Mac App Distribution identity can’t be run locally.

  • Provisioning profile problems — For example, your profile might not whitelist the Mac you’re running the app on. Or you might be using an entitlement that requires whitelisting by a profile but isn’t actually included in the profile.

Three things:

  • How do you plan to distribution your app? Via the Mac App Store? Or independently, using Developer ID?

  • What does the following report:

    $ codesign -d -vvv /path/to/your.app

    .

  • And this?

    $ security cms -D -i /path/to/your.app/Contents/embedded.provisionprofile

    .

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"