Creating an app icon that can be use for macOS apps It also supports retina screens.
.png 👉 .icns
- Download IconMaker.app 👈 (It’s just an .applescript won’t bite)
- If you get a warning while using the app go to
MacOS prefs -> security & privacy -> General -> click open anyway
- Drag and drop your icon.png (1024x1024px) onto the IconMaker.app and your done 🎉
here is an app icon I created in Illustrator:
Now you have the .icns file that can be added to your xcode project.
Build IconMaker.app your self:
This applescripts can convert a .png to an .icns file in 4 simple steps:
- Open the AppleScript app
- Copy and paste the code into AppleScript from JoeFrizzell in the link bellow.
- Save as: IconMaker.app
- Drag and drop your .png onto the IconMaker.app you just created.
Credits to JoeFrizzell via: http://apple.stackexchange.com/a/140361/179041
Running the app requires:
MacOS Sierra has stricter security than before. To bring back running apps from unidentified developers simply write sudo spctl
--master-disable in terminal and hit enter, as per: http://osxdaily.com/2016/09/27/allow-apps-from-anywhere-macos-gatekeeper/ (You can always enable it after) Or you can build from source your self and GateKeeper won’t complain.
High Sierra update:
Since macOS high sierra, you need to be strict about size. Make sure the png size is exactly 1024x1024px. Or else it won’t work. Basically the
iconutil that IconMaker utilises has been upgraded in High Sierra. I tested a 1000x1000px file in Sierra and it worked. But not in High Sierra. So make sure your source png is the correct size. 💪
Doing all of this with just terminal:
- Create a png file that is exactly 1024x1024px
- Make sure all your icons are named exactly like the bellow: (it can be the same 1024x1024px png, but they must be named correct)
icon_16x16.png email@example.com icon_32x32.png firstname.lastname@example.org icon_128x128.png email@example.com icon_256x256.png firstname.lastname@example.org icon_512x512.png email@example.com
Put the png’s in a folder named: someIcon.iconset and put the folder on your desktop
Open Terminal and paste this line:
iconutil --convert icns ~/Desktop/someIcon.iconset
- You should now have someIcon.icns on your Desktop ready to be used in your macOS app projectgit
sips -Z 512 ~/Desktop/someIcon.png
You could add shell commands that resizes the images for you, in the applescript to actually resize each image. But I didn’t have time for this step this time around. Maybe next time I revisit this app ill implement it. You can also probably make a photoshop script that does all the resizing and renaming for you. let me know if you make any of this ideas and ill be sure to share it with the world. Thanks for reading ✌️