-i <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">, --icon <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">
FILE.ico: apply the icon to a Windows executable. FILE.exe,ID: extract the icon with ID from an exe. FILE.icns: apply the icon to the .app bundle on Mac OS. If an image file is entered that isn’t in the platform format (ico on Windows, icns on Mac), PyInstaller tries to use Pillow to translate the icon into the correct format (if Pillow is installed). Use “NONE” to not apply any icon, thereby making the OS show some default (default: apply PyInstaller’s icon)
mac 用pyinstaller打包,使用icns图标格式而不是ico
注意要将icns图标放在py一个文件夹中,可以利用转换器将图片转化为icns图标,
一个在线的转化icns网址,下载稍慢但是可以用
pyinstaller -w -i pika.icns -F 科勒小雪花.py
不知道为什么,一定要加-w才可以成功,-w 是去掉黑窗口,加了之后才能生成有正常图标的程序,
然后你就可以生成一个能在mac上运行的有可爱图标的程序了~