macOSをCatalinaにアップデートしたらxcrun: error: invalid active developer pathが出たので解消する

Catalina 10.15.4 にバージョンアップした後に、makeコマンドを実行したときにこんなエラーが出た。

$ make build
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

調べてみるとどうやらxcode-selectをインストールしないといけないっぽいのでやってみる。

$ xcode-select --install
xcode-select: note: install requested for command line developer tools

再びmakeコマンドを打つと無事実行できた。