Code Signature Invalid

 When I run my Mac app, it crashes immediately, and the crash log says Exception Type: EXC_CRASH (Code Signature Invalid). What is going on here?


A: The crash log indicates that your app is signed with your Mac App Store distribution identity, with the certificate’s Subject Common Name starting with “3rd Party Mac Developer Application.” Mac apps signed this way can no longer be run directly. Here’s the background on this.

Over time, more Mac App Store technologies have been added that require entitlements that come from a provisioning profile. This started with push notifications and iCloud. Later, Game Center and Maps were added to the list.

Distribution builds of apps that use those technologies may be submitted to iTunes Connect for review, but until then, aren’t allowed to run and are killed on launch. This is because distribution provisioning profiles do not contain a list of hardware UUIDs that restrict the app to a specific set of devices. This is similar to iOS where distribution builds have never been allowed to run on a device.

Recently, the com.apple.developer.team-identifier entitlement was added to all new Mac provisioning profiles. This means that, going forward, distribution builds of Mac apps cannot be run directly; they are for submitting to iTunes Connect for app review only.

Instead, developers should adopt the Archive Build Workflow in QA1778: How to reproduce bugs reported against Mac App Store submissions for testing the builds that they plan to submit for the Mac App Store. On Xcode 6, select Export as a Mac Application. You won't see any chance to select your development signing identity, but Xcode will export the app from the archive as it was signed at build time. So the result will be the same.

You can create an installer package containing your development-signed app by hand with the productbuild tool, like this:

$ productbuild --component Sample.app /Applications --sign “3rd Party Mac Developer Installer:" Sample.pkg

Then install the package as documented in Testing the Mac Installer Package:

$ sudo installer -store -pkg Sample.pkg -target /

This workflow means that you will need to add your beta testers’ test systems to your Mac Developer Program account so they will be able to run your app.

Another possibility is to use Xcode Organizer > Export > Export a Developer ID-signed Application. Developer ID-signed apps can be run by anyone. However, code that uses technologies only available to Mac App Store apps, such as receipt validation, iCloud, and push notifications, will not work if your app is Developer ID-signed. You might need to temporarily disable those parts of your app if you opt for the Developer ID testing approach.





  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值