macOS 下 pyinstaller 报错 "Error while signing the bundle ... ... .DS_Store files cannot be a symlink"

macOS 下 pyinstaller 报错 "Error while signing the bundle ... ... .DS_Store files cannot be a symlink"

今天在 macOS 下使用 pyinstaller 打包程序的时候,遇到一个 codesign 签名的错误。

Error while signing the bundle。我一开始还以为是签名证书的问题,还按照 https://stackoverflow.com/a/68937623/5777080 这里的答案新建了一个自签名的 code signing 证书。但是依然报同样的错误。

其实这个报错的原因是在第二句话:.DS_Store files cannot be a symlink

因为 pyinstaller 拷贝的静态文件目录中,出现了 .DS_Store 文件。只要将 .DS_Store 文件删除即可。

find ./ -name .DS_Store -delete

签名成功后,使用 codesign 命令检查 app 包,可以看到 Identifier 已经正确变成了指定的 bundle id。另外 Signature 签名方式显示的是 adhoc,这个大概可以理解为 “特定的,开发测试版本,无需认证”。

Leave a Reply

Your email address will not be published. Required fields are marked *