我运行这一行:
codesign --verbose --force --deep --sign "Developer ID Application: Company" Company.app
我收到此错误:
Company.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/me/repo/client/Company.app/Contents/MacOS/include/python2.7
我已将问题范围缩小到以下事实:我有一个应用程序包,其中包含 Contents/MacOS 目录中的一些子目录,这些子目录的名称中包含句点。根据this ,codesign对此感到窒息,因为它认为任何带有句点的目录本身就是一个包并拒绝它(强调我的):
Note that a location where code is expected to reside cannot generally contain directories full of nested code, because those directories tend to be interpreted as bundles. So this occasional practice is not recommended and not officially supported. If you do do this, do not use periods in the directory names. The code signing machinery interprets directories with periods in their names as code bundles and will reject them if they don't conform to the expected code bundle layout.
我的包是由 PyInstaller 创建的(测试版本 3.1 和 3.2),并且目录会自动拉入。以下是所有存在此问题的目录:
Company.app/Contents/MacOS/include/python2.7
Company.app/Contents/MacOS/lib/python2.7
Company.app/Contents/MacOS/lib/python2.7/config
Company.app/Contents/MacOS/qt_menu.nib
Company.app/Contents/MacOS/tcl/http1.0
Company.app/Contents/MacOS/tcl/opt0.4
我看了here ,并且没有提到这个问题,我想知道是否有人有配置想法可以解决问题而不完全消除依赖项。
使用以下命令创建 bundle :
python $PYINSTALLER/pyinstaller.py \
-n $APP_NAME \
--paths $MODULE_SEARCH_PATH \
--windowed \
--icon $BUNDLEFILES_DIR/$APP_NAME.icns \
--distpath $BUNDLE_DIR/dist \
--osx-bundle-identifier com.company.$APP_NAME \
--exclude-module core.InternalTool \
main.py
最佳答案
我遇到了同样的问题,经过很多的失败,我终于可以让codesign
工作了。我为此编写了一个配方,其中包含一个脚本来自动修复您的应用程序:Recipe OSX Code Signing Qt .
关于macos - Codesign OSX 应用程序包,MacOS 目录名称中包含句点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37737829/