The best think to do is to keep the latest Xcode version in its location in /Applications directory and to create different Xcode subdirectories under /Applications for the older versions e.g.:
In my case the latest version (for the moment) is Xcode 6.1.1.
So, if you download the dmg file for version 4.5 (see ref. 5 below), e.g xcode4520418508a.dmg then you can install it in its folder, i.e.: /Applications/Xcode4.5
Then, the above picture will be as follows:
/Applications/Xcode4.5/Xcode.app
After that, it is a good practice to rename the corresponding Xcode.app file to a different name to be more relevant to its version like Xcode4.5.app. After a while, the new name will appear in your Applications widget.
The default Xcode and command line tools selected in our operating system environment is the latest. We may use the command xcode-select --print-path to display the default Xcode version used:
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
and also the command line compiler clang -v to display the related version information:
$ clang -v
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Now, we can use the xcode-select --switch to change the default Xcode and command line tools to the one that we need to use:
$ sudo xcode-select --switch /Applications/Xcode4.5/Xcode4.5.app/Contents/Developer
$ xcode-select --print-path
/Applications/Xcode4.5/Xcode4.5.app/Contents/Developer
$ clang -v
Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Finally, you may refer to the following links for further information and tips.
1. Install Multiple Versions of Xcode: Updated for Xcode 5 and Greater
2. Using multiple versions of Xcode in stack overflow
3. Download latest Xcode version
4. Technical Note TN2339 - Building from the Command Line with Xcode FAQ
5. Download Xcode versions from Apple
/Applications/Xcode.app # this is the latest Xcode installation
/Applications/Xcode4.5
/Applications/Xcode4.5.2
/Applications/Xcode5.1.1In my case the latest version (for the moment) is Xcode 6.1.1.
So, if you download the dmg file for version 4.5 (see ref. 5 below), e.g xcode4520418508a.dmg then you can install it in its folder, i.e.: /Applications/Xcode4.5
Then, the above picture will be as follows:
/Applications/Xcode4.5/Xcode.app
/Applications/Xcode4.5.2/Xcode.app
/Applications/Xcode5.1.1/Xcode.appThe default Xcode and command line tools selected in our operating system environment is the latest. We may use the command xcode-select --print-path to display the default Xcode version used:
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
and also the command line compiler clang -v to display the related version information:
$ clang -v
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Now, we can use the xcode-select --switch to change the default Xcode and command line tools to the one that we need to use:
$ sudo xcode-select --switch /Applications/Xcode4.5/Xcode4.5.app/Contents/Developer
$ xcode-select --print-path
/Applications/Xcode4.5/Xcode4.5.app/Contents/Developer
$ clang -v
Apple clang version 4.1 (tags/Apple/clang-421.11.65) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Finally, you may refer to the following links for further information and tips.
1. Install Multiple Versions of Xcode: Updated for Xcode 5 and Greater
2. Using multiple versions of Xcode in stack overflow
3. Download latest Xcode version
4. Technical Note TN2339 - Building from the Command Line with Xcode FAQ
5. Download Xcode versions from Apple

No comments:
Post a Comment