Skip to content

Instantly share code, notes, and snippets.

@ncornette
Created November 19, 2015 15:27
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 ncornette/03da7c724be6523c2c6a to your computer and use it in GitHub Desktop.
Save ncornette/03da7c724be6523c2c6a to your computer and use it in GitHub Desktop.
Command to find unused layouts in android project
#!/bin/bash
# Find Unused (unreferences) layouts in android project
for f in `find ./src -iname "*.xml" | grep res/layout`; do echo $f ; git grep --count -e "R\.layout\.$(basename $f .xml)\W" --or -e "@layout/$(basename $f .xml)\W" | wc -l ; done | grep -B1 "^0"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment