With the recent release of the new iPad, app resources (images, videos, etc.) will be significantly larger. Apple has raised the 3G app download to 50mb to compensate for the larger images, but it may still be a tight squeeze. This is especially true for universal apps that have to support low and high resolutions of iPhones, iPods, and now the iPads. Often during the construction of an app we will go through many revisions to the UI, moving new assets in and out of the app. In this confusion, there’s a chance that the developer might forget to remove the image as a resource from the project when it is no longer used.
We have written a script to automate the process of finding unused resources:
It’s simple to use, just clone the repo and invoke the script providing a relative path to the project’s working directory. For example:
The script can optionally include or exclude comments, and can be configured to provide a varying amount of output to the console. It recursively searches the provided project directory; looking at various files such as headers, implementation files, and nibs. It’s easy to edit the script to include resources of any given file extension.
There are some known issues, for example,
stringWithFormat:@"%@.png" won’t work. Feel free to fork and please report bugs.
About the Author
BiographyMore Content by Pivotal Labs