Skip to content

Instantly share code, notes, and snippets.

@devmanuj
Last active December 19, 2015 08:38
Show Gist options
  • Save devmanuj/5926753 to your computer and use it in GitHub Desktop.
Save devmanuj/5926753 to your computer and use it in GitHub Desktop.
Script for extracting optimised images from an ipa file using Xcode utility PNGCRUSH.
Running this script requires that you rename the exptension of ipa to zip and then move images in payload folder to a common folder in which this ExtractedImages.sh exists. Run this script it should find all the images and extract it in RevertedImages folder.
#!/bin/bash
#create a folder to put reverted images in
mkdir RevertedImages
#looping for png files in . or $1 parameter
for png in `find . -name '*.png'`
do
name=`basename $png`
#echo $name
#pngcrush path with -revert-iphone-optimizations parameter
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/
pngcrush -revert-iphone-optimizations $name RevertedImages/$name
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment