

Now we have debug and beta alongside AppStore build on same device, with version numbers rendered onto development builds icons. Since Pure Awesome sample app has multiple bundle identifiers and targets, I run it multiple times with different arguments.Īnd that’s all there is to it. And finally saves it to PATH_TO_OUTPUT_ICON. Finds average icon colour from original icon image to use as text colour. The script takes one large PNG image and creates AppIcon.appiconset for Apple Xcode with all icons prefilled for iPhone.

It computes font size based on image size. AppIconswift (Generate the swift script for AppIcon) swift appicon appiconset Updated Swift PepperoniJoe / Make-Icons-Swiftly Star 14. Renders iOS’s dock inspired blurred bar, BUILD_TYPE string, VERSION_NUMBER, BUILD_NUMBER onto every png image. Script enumerates contents of PATH_TO_ORIGIN_ICON folder, uses my UIImageEffects category Swift, OS X port. Swift -sdk $(xcrun -show-sdk-path -sdk macosx) "$PATH_TO_ICON_PROCESSOR" "$PATH_TO_ORIGIN_ICON" "$PATH_TO_OUTPUT_ICON" "$VERSION_NUMBER" "$BUILD_NUMBER" "$BUILD_TYPE" Run script using swift -sdk $(xcrun –show-sdk-path –sdk macosx) (forcing it to point OS X SDK) and variables defined. VERSION_NUMBER=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$") PATH_TO_OUTPUT_ICON="$PROJECT_DIR/Pure Awesome/Assets.xcassets/AppIconDebug.appiconset" PATH_TO_ORIGIN_ICON="$PROJECT_DIR/Pure Awesome/Assets.xcassets/AppIcon.appiconset" PATH_TO_ICON_PROCESSOR="$PROJECT_DIR/Scripts/icon_processor.swift" Lastly define optional build type character. Define version and build number variables using PlistBuddy. Add new Run script build phase in iOS target just under target dependencies in Build Phases tab.ĭefine a path to icon_processor.swift, original icon, beta / debug icon. It will make following along easier.Ĭopy icon_processor.swift to your project folder.
#Appicon swift download#
You may want to download whole sample project (make sure you are viewing icon_version_rendering branch). Start by downloading icon_processor.swift.
#Appicon swift code#
All of the code is written in Swift 2.0 and sample project is Xcode 7.0 beta 6 project. That blog post it’s a prerequisite for following technique of rendering app version and build number onto icon described below. Last is only used when I directly build and run from Xcode. I like to have AppStore version alongside βeta version that is distributed to testers, as well as having separate debug builds.

It’s quite handy to have multiple builds of same app on one device for developing purposes.
