Our Xcode version can see the version that is in use and the version path based on the Xcode > Preferences > Locations path.
This article describes the Xcode version that is modified using the Xcode-select command on a terminal basis.
The following commands are available for use in terminal xcode-select:
1. Xcode-select [-h,–help]
2. Xcode-select [-p,–print-path]
3. Xcode-select [-S, –switch]
4. Xcode-select [-v,–version]
5. Xcode-select [-r,–reset]
To view xcode-select you can use the command, using the following command xcode-select-h
or Xcode-select--help
View the Xcode version path that is currently in use, using the following command xcode-select-p
or Xcode-select--print-path
View Xcode-select version Xcode-select-v
or Xcode-select--version
Reset to the default command line tools path Xcode-select-r
or Xcode-select-reset
Modify Xcode use version
sudo xcode-select--switch/applications/xcode.app/contents/developer
Or
sudo xcode-select-s/applications/xcode.app/contents/developer
This paper reproduces http://blog.sina.com.cn/s/blog_605409770102uwxc.html