sips -z 16 16 icon.png --out icons.iconset/icon_16x16.png
sips -z 32 32 icon.png --out icons.iconset/icon_16x16@2x.png
sips -z 32 32 icon.png --out icons.iconset/icon_32x32.png
sips -z 64 64 icon.png --out icons.iconset/icon_32x32@2x.png
sips -z 64 64 icon.png --out icons.iconset/icon_64x64.png
sips -z 128 128 icon.png --out icons.iconset/icon_64x64@2x.png
sips -z 128 128 icon.png --out icons.iconset/icon_128x128.png
sips -z 256 256 icon.png --out icons.iconset/icon_128x128@2x.png
sips -z 256 256 icon.png --out icons.iconset/icon_256x256.png
sips -z 512 512 icon.png --out icons.iconset/icon_256x256@2x.png
sips -z 512 512 icon.png --out icons.iconset/icon_512x512.png
sips -z 1024 1024 icon.png --out icons.iconset/icon_512x512@2x.png
Additional comment, when you create .icns file, you need to rename all the pic files with prefix "icon_", otherwise, iconutil will fail with error message: ".iconset:error: Failed to generate ICNS." which is not informative at all.
即icons.iconset文件夹内的文件必须为icon_开头,否则生成icns会报错
网友评论