To recreate features of existing apps, we can use a big clue: the images an app uses. This will often give us insight into how the feature was built.
You can right click on an App in iTunes and see the app’s .ipa file.
An .ipa file is just a zip file that is easily expanded resulting in a Payload folder that has the actual .app.
But we can’t just double click on the images and open them in something like Preview.app.
During app compilation Xcode optimizes all images so they aren’t readable by standard tools like Preview.app.
We need to undo the optimization and restore the images back to their original form.
The tool that the SDK uses to optimize the images is pngcrush and starting with the 3.2 SDK, Apple added the ‘revert-iphone-optimizations’ option to undo this optimization.
I wrote a quick ruby script called appcrush that automates this process.
Point appcrush at an .ipa file from the iTunes AppStore and it:
- expands the zip file
- finds all the images
- runs pngcrush with the revert-iphone-optimizations option on each image
appcrush '/Users/boctor/Music/iTunes/Mobile Applications/iBooks.ipa'
You can find appcrush here: https://github.com/boctor/idev-recipes/tree/master/Utilities/appcrush
Hey,
I always get this error while running the ruby script.
/usr/bin/ruby: line 19: pngcrush: command not found
/usr/bin/ruby: line 21: syntax error near unexpected token `(‘
/usr/bin/ruby: line 21: `destination = File.join(ENV[‘HOME’], ‘Desktop’)’
The way I point the IPA to the script I do linke this:
ruby appcrush.rb ‘/Users/boctor/Music/iTunes/Mobile Applications/iBooks.ipa’
Could you point me to the right way? 🙂
Hey Max,
3 things to try:
Would you please help me to figure out what problem is it…
Note: Actual Path is replaced by dots
While reading /Users/../../PulseNews-v1.0.2 Images pngcrush caught libpng error:
Read Error
Cannot overwrite input file /Users/../Music/iTunes/Mobile Applications/PulseNews-v1.0.2/Payload/Pulse News.app/whiteframe@2x.png
If it’s still somehow relevant – try re-adding the resource to the project. It helped me…
Great tip, thanks for sharing your script as well. Worked great!
What is the destination? I don’t see anything in the script path or in the ipa path. The only output I see in the terminal is “libpng warning: Input PNG is not optimized for iPhone OS. Copying source file to destination…”
Nevermind, found them on the desktop
Thanks , brilliant!
How do I even run this? Or where do I rum this?
It’s great.
It reminds me that: can we replace the png in the ipa in case that I want to verify the element of the app?
For example, I want to replace the background image of one page(of course there exists such an image)
i’m a bit of a noob to the terminal. i git cloned your repo, but how to i actually install and use appcrush? currently the comman is not found. any advice would be super helpful, as i don’t know what to search for on the googles.
Open a Terminal window and from the Finder drag the appcrush.rb file into that window. After the path appears in the window, add a space and the path to the ipa file.
I can’t do it 😦 either in cmd or interactive ruby.
What shall I do?
Can you change the script to be used with the iPad Version?
Thanks for sharing your script. It is working great.
Hey can you make a video on how to use it plzzz 🙂
Please try this online extracting tool: http://iphone-ipk-png.raisedtech.com/
What you need to do is just uploading your app file, then it will extract all of the images for you. it helps me much, worth having a try
Dan, about decompile de Objective-C code, have a software for this?
[…] Extracting images from Apps in the AppStore Pngcrush Technical Q&A QA1681 Viewing iOS-Optimized PNGs .ipa (file extension) This entry […]
What is the best way to view the PNG files that are inside an iOS app file (.ipa) file?…
Did you not read the README? Or the blog post (http://idevrecipes.com/2010/12/06/extracting-images-from-apps-in-the-appstore/ )? Essentially you need to run the following in Terminal: appcrush ‘/Users/boctor/Music/iTunes/Mobile Applications/iBooks.ipa…
[…] wrote a Ruby script called App Crush that would uncrush the png files (with instructions here) but it hasn’t been updated in about a year. Since then, Apple has changed how Xcode is […]
Does this trick still works?