How to remove "Warning: xcodebuild exists but failed to execute" warning message of MacPorts.

Run the following command.

$ sudo xcode-select -switch /Applications/Xcode.app