Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Converts an (yup, Adobe Illustrator) file into a macOS icon.icns file
mkdir icon.iconset
qlmanage -t -s 1024 -o .
mv icon.png
convert icon.png -gravity center -background white -extent 1024x1024 -alpha Set -colorspace sRGB -define png:format=png32 icon.png
sips -z 16 16 icon.png --out icon.iconset/icon_16x16.png
sips -z 32 32 icon.png --out icon.iconset/icon_16x16@2x.png
sips -z 32 32 icon.png --out icon.iconset/icon_32x32.png
sips -z 64 64 icon.png --out icon.iconset/icon_32x32@2x.png
sips -z 64 64 icon.png --out icon.iconset/icon_64x64.png
sips -z 128 128 icon.png --out icon.iconset/icon_64x64@2x.png
sips -z 128 128 icon.png --out icon.iconset/icon_128x128.png
sips -z 256 256 icon.png --out icon.iconset/icon_128x128@2x.png
sips -z 256 256 icon.png --out icon.iconset/icon_256x256.png
sips -z 512 512 icon.png --out icon.iconset/icon_256x256@2x.png
sips -z 512 512 icon.png --out icon.iconset/icon_512x512.png
cp icon.png icon.iconset/icon_512x512@2x.png
iconutil -c icns icon.iconset
rm -R icon.iconset
rm icon.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.