如何为Catalina发行版从Pyinstaller创建代码设计应用程序

2024-10-04 03:22:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我在公证和分发从pyinstaller打包到Catalina的应用程序时遇到问题

在我的authentications.plist中,我将com.apple.security.cs.allow-jit和com.apple.security.cs.allow-unsigned-executable-memory设置为true

我还尝试设置com.apple.security.cs.disable-library-validation。然而,如果我这样做,我甚至无法打开它。它只是让我把它扔掉

这是我的代码签名命令

codesign --deep --force --options runtime --entitlements entitlements.plist --sign "$DEVELOPER" "$APP.app" --timestamp

当我打开时,我得到了这个

[1276] Error loading Python lib '/var/folders/kb/ww5w7w_s45139t2n329cr3lw0000gn/T/_MEI3Jv8Ln/libpython3.7m.dylib': dlopen: dlopen(/var/folders/kb/ww5w7w_s45139t2n329cr3lw0000gn/T/_MEI3Jv8Ln/libpython3.7m.dylib, 10): no suitable image found.  Did find:
    /var/folders/kb/ww5w7w_s45139t2n329cr3lw0000gn/T/_MEI3Jv8Ln/libpython3.7m.dylib: code signature in (/var/folders/kb/ww5w7w_s45139t2n329cr3lw0000gn/T/_MEI3Jv8Ln/libpython3.7m.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /var/folders/kb/ww5w7w_s45139t2n329cr3lw0000gn/T/_MEI3Jv8Ln/libpython3.7m.dylib: stat() failed with errno=3

在运行pyinstaller之前,我也尝试过codesign -f -s "$DEVELOPER" /path/to/libpython3.7m.dylib,但是当我在Catalina机器上运行应用程序时,我得到了“Killed:9”

如果我不从系统首选项进行代码设计和强制允许,它可以正常工作>;它运行的安全性

我希望能够正常分发,而用户不必这样做


Tags: com应用程序applekbvarcsfoldersplist