Has anyone a one-line to find unused images in an Xcode project? (Assuming all the files are referenced by name in code or the project files - no code generated file names.)
I made a very slight modification to the excellent answer provided by @EdMcManus to handle projects utilizing asset catalogs.
#!/bin/bash
for i in `find . -name "*.imageset"`; do
file=`basename -s .imageset "$i"`
result=`ack -i "$file" --ignore-dir="*.xcassets"`
if [ -z "$result" ]; then
echo "$i"
fi
done
I don't really write bash scripts, so if there are improvements to be made here (likely) let me know in the comments and I'll update it.