Skip to content

Instantly share code, notes, and snippets.

@davepeck
Created August 30, 2011 17:22
Show Gist options
  • Save davepeck/1181411 to your computer and use it in GitHub Desktop.
Save davepeck/1181411 to your computer and use it in GitHub Desktop.
List unused images in an Xcode Project
#!/bin/sh
# Find PNG images not referenced by any xib, m/h, and plist files
# Works from current directory downward.
refs=`find . -name '*.xib' -o -name '*.[mh]' -o -name '*.plist'`
for image in `find . -name '*.png'`
do
image_basename=`basename $image`
image_name=${image_basename%.*}
if ! grep -q $image_name $refs; then
echo $image
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment