首先需要有证书,这个不多说。如图设置:
Xcode的签名,其实也是使用CodeSign。比如以下签名出错情况(对已经不同签名的内容再次签名):
CodeSign /Users/tsitmac/Develop/tssuite/Build/Products/Debug/tssuite.app (in target 'tssuite' from project 'tssuite') cd /Users/tsitmac/Develop/tssuite export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate Signing Identity: "Apple Distribution: Taishan (ABCD1234)" /usr/bin/codesign --force --sign EFGH9876 --entitlements /Users/tsitmac/Develop/tssuite/Build/Intermediates.noindex/tssuite.build/Debug/tssuite.build/tssuite.app.xcent --timestamp\=none --generate-entitlement-der /Users/tsitmac/Develop/tssuite/Build/Products/Debug/tssuite.app /Users/tsitmac/Develop/tssuite/Build/Products/Debug/tssuite.app: code object is not signed at all In subcomponent: /Users/tsitmac/Develop/tssuite/Build/Products/Debug/tssuite.app/Contents/MacOS/Reader Command CodeSign failed with a nonzero exit code