Last active
October 24, 2017 21:01
-
-
Save Sadmansamee/a35903f8f7aa8a981c5177d9e1b2f8d2 to your computer and use it in GitHub Desktop.
Count lines of code in Xcode project
This file contains hidden or 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
1. Open Terminal | |
2. cd to your Xcode project | |
3. Execute any following command: | |
a) Including Pods: find . -name "*.swift" -print0 | xargs -0 wc -l | |
b) Excluding Pods: find . -path ./Pods -prune -o -name "*.swift" -print0 ! -name "/Pods" | xargs -0 wc -l | |
c) Swift and Obj-C: find . -type d \( -path ./Pods -o -path ./Vendor \) -prune -o \( -iname \*.m -o -iname \*.mm -o -iname \*.h -o -iname \*.swift \) -print0 | xargs -0 wc -l | |
Alternative way | |
# brew install cloc | |
# cd path/to/project/ | |
# cloc . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment