电子应用 Mac 应用商店图标问题 -> "missing required icon"

electron app Mac app store icon issue -> "missing required icon"

我正在尝试将 mas -> .pkg 文件上传到 mac 应用商店,它不断给我以下错误

错误 ITMS-90236:"Missing required icon. The application bundle does not contain an icon in ICNS format, containing both a 512x512 and a 512x512@2x image. For further assistance, see the Apple Human Interface Guidelines at https://developer.apple.com/macos/human-interface-guidelines/icons-and-images/app-icon"

我在build中添加了512*512的ICNS文件和图标的png文件。

如果我创建 DMG 文件,图标可以正常工作。它还在 mac 扩展坞及其安装程序中向我展示了正确的图标。 那么我到底需要在哪里添加我的图标呢?

我可以通过创建一个名为“icon.iconset”的文件夹来修复它。在此文件夹中保留两个 png。

对于每个文件,图像大小都是相同的像素尺寸。例如 icon_512x512.png 是 512 x 512 像素。当文件名标有@2x 时,像素尺寸将加倍。所以 icon_512x512@2x.png 将是 512 x 512 像素。

确保文件夹设置正确后,我导航到包含我刚刚在终端中创建的文件夹的文件夹,然后运行执行以下命令。

iconutil --convert icns icon.iconset

这生成了一个 .icns 文件

尝试创建一个名称为 icon.iconset 的文件夹,并在该文件夹中添加一张尺寸为 512 X 512 的图像,并将图像名称设为 icon_512x512.png。

再添加一张尺寸为 1024 X 1024 的图片,图片名称为 icon_512x512@2x.png

然后导航到该源文件夹 (icon.iconset) 尝试执行以下命令。

iconutil --convert icns icon.iconset