Alex Rivera | Logout

How to find unused images in an Xcode project?

Asked 2011-05-24T15:55:53.853
109

Has anyone a one-line to find unused images in an Xcode project? (Assuming all the files are referenced by name in code or the project files - no code generated file names.)

These files tend to build up over the life of a project and it can be hard to tell if it's safe to delete any given png.

Edit
Report

1 Answer

2

You can make a shell script that grep your source code and compare the founded images with your project folder.

Here the man(s) for GREP and LS

Easily you can loop all of your source file, save images in array or something equals and use

cat file.m | grep [-V] myImage.png

With this trick, you can search all images in your project source code!!

hope this helps!

answered 2011-05-24T16:09:24.003

Your Answer