Created
November 19, 2015 15:27
-
-
Save ncornette/03da7c724be6523c2c6a to your computer and use it in GitHub Desktop.
Command to find unused layouts in android project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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