应用程序在pyinstaller Mac Os之后关闭

时间:2018-06-09 10:09:00

标签: python macos pyinstaller agent

问题是,当我尝试使用pyinstaller打开从我的Python脚本转换为Mac应用程序的应用程序时,它会在一秒钟后关闭。

我正在使用带有这样的标志-w -F的pyinstaller sudo pyinstaller client.py -w -F 所以我在dist文件夹中有2个文件

client

这是exec文件。和

client.app

所以当我尝试运行exec文件时 - 一切正常,但是当我点击client.app时,我在Dock中看到了一秒钟的图标,然后它就消失了。但是,如果我进入client.app/Contents/MacOS/并运行客户端,它会再次运行。

我认为问题可能出在Info.plist文件中,但我并不是

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict><key>CFBundleDisplayName</key>
<string>client</string>
<key>CFBundleName</key>
<string>client</string>
<key>CFBundleIdentifier</key>
<string>client</string>
<key>CFBundleExecutable</key>
<string>MacOS/client</string>
<key>CFBundleIconFile</key>
<string>icon-windowed.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.0.0</string>
<key>LSBackgroundOnly</key>
<string>0</string>
</dict>
</plist>

客户端 - 是控制台程序。那么如何解决client.app的问题?

0 个答案:

没有答案