Count total number of lines in an Xcode project

user3892683 picture user3892683 · Feb 27, 2015 · Viewed 13.6k times · Source

What is the way to count total number of lines in an Xcode Project? I can see number of lines in an individual file but I need a sum up of all the lines in a project.

Answer

Tim picture Tim · Feb 27, 2015

A lightweight solution if you're using Homebrew (and a fan of the terminal) is the command-line program 'Cloc' (count lines of code). It breaks down the output for languages used in your project and gives you other useful information.

Cloc

$ brew install cloc 
$ cd path/to/project/ 
$ cloc .