For iOS development sudo xcode-select -s /Library/Developer/CommandLineTools might not work. For my build flow, we make use of Cocoapods and a post-install script that leverages xcodebuild. When attempting to run, I get the following error:
error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
sudo xcode-select -r resets my state to normal, but does not silence the warnings we're discussing here.