I created a simple HelloWorld test app and try to run it on my own device with a developer cert (paid). Everything seems to be ok and the certs are being managed automatically be XCode. No errors. Runs fine on several simulators as well as latest iOS versions and also on XCode-beta.
The problem is: when I try to run it on my real (connected) device, I get this code signing error (/usr/bin/codesign receives an "Illegal instruction" signal and crashes).
I browsed several forums and tried several things. None helped.
Here is the XCode message (from XCode-10-beta, but same is true for XCode 9.4):
...
Signing Identity: "iPhone Developer: xxx xxx (xxx)"
Provisioning Profile: "iOS Team Provisioning Profile: *"
(xxxxxxxxxxx)
/usr/bin/codesign --force --sign 82F025A538B4126E06BD4EAB2E3D8A570CAB680C --entitlements /Users/lothar/Library/Developer/Xcode/DerivedData/HelloWorld2-awursthwknjafwgsizbtcixufbmq/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphoneos/HelloWorld2.build/HelloWorld2.app.xcent --timestamp=none /Users/lothar/Library/Developer/Xcode/DerivedData/HelloWorld2-awursthwknjafwgsizbtcixufbmq/Build/Products/Debug-iphoneos/HelloWorld2.app
Command CodeSign failed with a nonzero exit code
...
and when executing from terminal:
/usr/bin/codesign --force --sign 82F025A538B4126E06BD4EEB2E3D8A570CAB680C --entitlements /Users/lothar/Library/Developer/Xcode/DerivedData/HelloWorld2-awursthwknjafwfsizbtcixufbmq/Build/Intermediates.noindex/HelloWorld2.build/Debug-iphoneos/HelloWorld2.build/HelloWorld2.app.xcent --timestamp=none /Users/lothar/Library/Developer/Xcode/DerivedData/HelloWorld2-awursthwknjafwfsizbtcixufbmq/Build/Products/Debug-iphoneos/HelloWorld2.app
Illegal instruction: 4
Any help highly appreciated.