Skip to content

Instantly share code, notes, and snippets.

@tangyumeng
Forked from danielctull/find-unused-images.sh
Created February 5, 2020 03:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tangyumeng/bfeb102dee14fb45d5816f35b9914cb1 to your computer and use it in GitHub Desktop.
Save tangyumeng/bfeb102dee14fb45d5816f35b9914cb1 to your computer and use it in GitHub Desktop.
A script to find images that are not used in an iOS project. Originally from http://stackoverflow.com/questions/6113243/how-to-find-unused-images-in-an-xcode-project
#!/bin/sh
PROJ=`find . -name '*.xib' -o -name '*.[mh]'`
for png in `find . -name '*.png'`
do
name=`basename $png`
if ! grep -q $name $PROJ; then
echo "$png is not referenced"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment