I had installed three different versions of xcode.app.
Firstly I uninstalled all xcode.apps and removed the related files, but using the following commands
xcode-select -v
xcode-select version 2345.1.
xcode-select returns that it already exists.
Then I install xcode.app version 8.3.3 and get the following message:
xcode-select version has not update
xcode-select -p returns
/Applications/Xcode.app/Contents/Developer
Entering xcode-select --install requires me to install.
But when I click on install, it shows me
could not update
and so on messages...