Skip to content

Instantly share code, notes, and snippets.

@youngshook
Created March 14, 2014 08:21
Show Gist options
  • Save youngshook/9543954 to your computer and use it in GitHub Desktop.
Save youngshook/9543954 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