1min read

ResourceSweeper for iOS

We are proud to announce that we have open-sourced a new tool that aim to facilitate some aspects of iOS development. ResourceSweeper analyzes projects and lists images that are included into project but not used in source code (because who cares to delete unused graphics from the project?), missing resolutions and also can convert png images that does not use alpha channel to jpg (yes, jpg is even faster than pngcrushed png).

ResourceSweeper consists of two parts: sweepresources and optimizepngs (more to come).

sweep_resources - analyzes project resources and source files to decide what files can be deleted and what resources have missing resolutions. As an output the script generates another python script ( which contains a list of likely unused resource files that are still in the project and a report file (report.txt) with a list of resources which are used / unused or missing resolutions.

Note: this is a simple tool - it doesn’t handle usage of resources which name is generated in runtime (for instance send by server or appended from two strings).

optimize_pngs - lists images that do not use alpha channel. It generates a python script ( which also contains a list of files which are candidates to convert to jpgs. Both output scripts take necessary changes to the pbxproj file into account. By using this tool we were able to reduce the size of several projects by about 20% (results may vary ;) ).

Get ResourceSweeper from GitHub while it’s hot and let us know your comments.

Darek Seweryn

Staff Software Engineer

Did you enjoy the read?

If you have any questions, don’t hesitate to ask!