I'm getting some strange code signing issues, when building my app for the AppStore target. I'm getting a runtime crash:
com.apple.xpc.launchd[1] (com.apple.xpc.launchd.oneshot.0x10000002[651]): Binary is improperly signed.
This led me to do some digging into the package that has been created:
If I check the signature as per Apple's suggested troubleshooting document:
https://developer.apple.com/library/content/technotes/tn2318/_index.html#//apple_ref/doc/uid/DTS40013777-CH1-TNTAG0
codesign --verify -vvvv -R='anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.1] exists and (certificate leaf[field.1.2.840.113635.100.6.1.2] exists or certificate leaf[field.1.2.840.113635.100.6.1.4] exists)' XXXX.app
XXXX.app: valid on disk
XXXX.app: satisfies its Designated Requirement
test-requirement: code failed to satisfy specified code requirement(s)
The test-requirement result according to the Apple doc suggests "This error indicates that the profile used to sign the app is missing its submission entitlement which can occur for example when a development Provisioning Profile is used to the sign the app instead of the intended distribution profile."
So...
Looking at the selected certificate in Xamarin Studio, "Mac Distribution: xxxx (xxxx)" is selected. However, if I look at the .app I see it's signed with a Developer not a Distribution certificate:
codesign -dvvv XXXX.app
Executable=/bin/x86/AppStore/XXXX.app/Contents/MacOS/Trackhunter
Identifier=XXXX
Format=app bundle with Mach-O thin (i386)
Authority=3rd Party Mac Developer Application: XXXX (XXXX)
Authority=Apple Worldwide Developer Relations Certification Authority
Authority=Apple Root CA
Signed Time=10 Jun 2017, 06:49:59
I believe its getting signed by the wrong certificate but I'm selecting the correct one in Xamarin Studio?