LoginSignup
3
2

More than 3 years have passed since last update.

iOSアプリのコード数を数えたい!!!

Posted at

そんなときありますよね。
clocを使うと簡単に数えられます。
Homebrewが必要なので、もし入ってなければいれましょう。

Homebrewを入れる

ターミナルから下記コマンドをうってください。

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

詳しいインストール方法は公式を見てください。

clocをインストール

clocをインストールしてください。

$ brew install cloc

ここまででお膳立ては完了!

使う

$ cloc (target directory name)

で対象のiOSアプリのライブラリを指定してやれば、下記のような結果が出力されます。

github.com/AlDanial/cloc v 1.82  T=5.73 s (329.7 files/s, 57670.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Objective C                    xxx          xxxxx          xxxxx         xxxxxx
Swift                          xxx           xxxx           xxxx          xxxxx
C/C++ Header                   xxx          xxxxx          xxxxx          xxxxx
HTML                            xx           xxxx            xxx           xxxx
(略)
-------------------------------------------------------------------------------

このcloc、Macのディレクトリであれば、何でもイケるので、便利です。

参考

Macでソースファイルのステップ数をカウントする方法

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2