How to set Xcode version as default in my Mac?
Asked Answered
H

6

113

Right now I have Xcode 6.0 (Beta) as a default version of my Xcode, but today I installed Xcode 6 from App Store and so I want to set Xcode 6 as a default version.

How can I set it?

Halftrack answered 18/9, 2014 at 10:56 Comment(2)
Just delete the beta because why would you need to keep it now.Maulstick
possible duplicate of How to change the default xcode version that is launched...?Maulstick
A
204

You could set the desired Xcode using this in the terminal:

sudo xcode-select -s <path/to/>Xcode.app

also, for more info, click here

Alaska answered 6/3, 2015 at 14:53 Comment(1)
It should be --s. sudo xcode-select --switchAfroamerican
S
63

Not directly related, however I assume most of you'd find this useful. Here is a link showing the command line FAQs.

The most 2 useful commands are.

  1. Printing the version of Xcode currently used by my tools

xcode-select --print-path

  1. Select the default Xcode for your command-line tools

sudo xcode-select -switch Xcode.app

E.g: sudo xcode-select -switch /Applications/Xcode5.1.1/Xcode.app

Slapup answered 12/8, 2016 at 12:35 Comment(1)
This answer was outdated!Trapan
R
51

It should be easy.

Solution 1:

  • Right click(or Control + Click) on Xcode project file (.xcodeproj).
  • Hover over 'Open with' and you will find all the Xcode apps from Applications directory listed.

Screen Shot of multiple Xcode apps

  • Now, hold down the Option key so that the “Open With” menu becomes “Always Open With”.
  • Continue to hold Option and select the Xcode version you want to set as the default for this file.

Solution 2:

Another way to apply this change to all the similar files is by clicking "Get info" and then making necessary change in 'Open With' section.

enter image description here

Rollins answered 18/9, 2014 at 13:6 Comment(2)
Solution 2 is the one I was looking for.Feigin
Terminal based answers didn't work for me to change from Xcode-10-beta to Xcode-9.4, Solution 2 did the trick, thanks!Bendigo
B
25

In 10.10 you should use (Assuming you've installed few versions of Xcode as Xcode6.1, Xcode6.2 and Xcode6.3, and want to make Xcode6.3 as default one).

sudo xcode-select --switch /Applications/Xcode6.3.app

This comes handy with some 3rd party applications which fails to reset the path from OSX like SVNX.app

Buskined answered 11/5, 2015 at 7:3 Comment(0)
T
5

This works for me I'm using vanilla titanium CLI.

Switch to desired Xcode version followed by ti setup for ios

sudo xcode-select -switch /path/to/Xcode.app/Contents/Developer/

ti setup ios

Tropical answered 20/12, 2016 at 8:8 Comment(0)
S
3

If you do a lot of work in both the current and beta version of Xcode run sudo xcode-select --switch /Applications/Xcode.app to select the default xcode and rename the beta Xcode to XcodeBeta.app or Xcode10.app.

Whenever you want to upgrade just rename the Xcode and restart terminal.

Stearoptene answered 18/9, 2018 at 19:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.