XCode Assets
During my journey with Xcode and developing an iPhone, MacOS and iPad application (I’m not ready for a reveal yet but stay tuned!), I’ve had to learn how to create icons/images in XCode, specifically for a bunch of different sizes.
Now, I have decades of development experience and one would think you’d learn over that span of time to use PhotoShop or other similar tools…
Well, I’m functional but no Picasso, so I’ve had to get creative with things and this script is one of them.
You can see that there are a LOT of image styles, sizes, and platforms that you have to add to your project for this to be submitted as an app to the App Store Connect. Once you’ve settled on an icon/image, you then have to go into your favorite graphical editor and create these sizes, shades (dark/tinted), etc.
You also have to account for other requirements like no transparency, no alpha channel, etc. These are Apple’s requirements for Assets and if you aren’t critically and absolutely right, your app gets rejected and won’t compile in their environment and you have to go fix it.
And as I said, if you are like me and aren’t that good at graphical manipulation, then yeah, you’re kind of stuck wasting a lot of time getting this right.
Well, unless you have this script.
Whatever it is, the way you tell your story online can make all the difference.
I’ll post a link to the script HERE.
But here’s the gist of how it works, but let’s assume a few things
You know how to code. This isn’t for beginners necessarily, but this isn’t to teach you how to use Xcode or even Python
You have to install python3, again, if you know how to code, you know how to install this
You’ll also need to install pillow (I use brew to manage the libraries, but use whatever you use to get them installed)You understand how to run code from the command line using bash
You get that you have to back shit up, make copies, etc. If you nuke your code using this script, that’s on you.
Feel free to use it, no license or otherwise use restrictions needed.
The code is very simple to use.
$ python3 resize_app_icons.py yourimagename
That’s it. Whether it’s
You’ll also see a new folder named “AppIcons” in the directory where you ran the script and inside of that folder will be your Assets folder structure, JSON files and all of the app icon sizes properly sized and formatted and rendered, ready for you to use in Xcode.
BACK YOUR CURRENT FOLDER UP BEFORE YOU DO THIS NEXT STEP
All you have to do is copy this entire folder into your XCode project folder and replace what is there.
Go back into Xcode and bingo! Your newly resized images are ready to go for App Store Connect.
Again, this is for those who really need a graphical crutch and boy does this one save me a TON of time.
I hope you find this useful!

