为有牺牲多壮志,敢教日月换新天。

签名可执行文件上传Mac App Store

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
➤微信公众号:山青咏芝
➤博主域名:https://www.zengqiang.org
➤GitHub地址:https://github.com/strengthen/LeetCode
➤原文地址:https://www.cnblogs.com/strengthen/p/16602651.html
➤如果链接不是山青咏芝的博客园地址,则可能是爬取作者的文章。
➤原文已修改更新!强烈建议点击原文地址阅读!支持作者!支持原创!
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
1、检查可执行文件是否启用sandbox
codesign --display --entitlements - ./commandlinetool
2、给可执行文件签名并启用 sandbox,先在命令行工具同目录创建一个 entitlements.plist:这里设置了 com.apple.security.app-sandbox 为 true 来启用 sandbox。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
 <true/>
<key>com.apple.security.inherit</key>
 <true/>
</dict>
</plist>
3、然后使用 codesign 进行签名:需要把 “3rd Party Mac Developer Application: Your Name” 替换为实际的证书名称。
codesign -s "3rd Party Mac Developer Application: Your Name" --entitlements ./entitlements.plist ./commandlinetool
codesign --entitlements ./entitlements.plist -s "Developer ID Application: " ./adb
posted @ 2022-08-19 17:03  为敢技术  阅读(83)  评论(0编辑  收藏  举报