Catalina Install Xcode Command Line Tools
To fix Xcode command-line tools, also known as xcode-select, but not Xcode — it’s confusing I know — try this command: xcode-select -install. If that doesn’t fix the issue, restart and try a reset: xcode-select -reset Xcode. Most developers will need all of Xcode. The best way to fix Xcode is to download and install Xcode yourself. Catalina update – softwareupdate -install -a won’t upgrade xcode from command line if there is a pending update (say you selected update xcode overnight) The Answer 10 4 people think this answer is useful.
- Can't Install Xcode Command Line Tools Catalina
- Catalina Install Xcode Command Line Tools
- Catalina Install Xcode Command Line Tools Free
The Question :
I am trying to update Xcode from the command line. Initially I tried running:
which resulted in this message:
So the question remains, is there a way to update Xcode from the command line?
- ehow.com/how_12225687_update-xcode-terminals.html try this
- @RohitPradhan does that work?
- @psjv …not tried yet,
- So obviously you can install from the app store… However I have a hunch that using a terminal command will be faster and more effecient than using the appstore (GUI?). Can anyone build on this idea? I put GUI in paranthesis because i dont know if im using the right terminology.
The Answer 1
What you are actually using is the command to install the Xcode command line tools – xcode-select --install
. Hence the error message you got – the tools are already installed.
The command you need to update Xcode is softwareupdate command [args ...]
. You can use softwareupdate --list
to see what’s available and then softwareupdate --install -a
to install all updates or softwareupdate --install <product name>
to install just the Xcode update (if available). You can get the name from the list command.
As it was mentioned in the comments here is the man page for the softwareupdate
tool.
2019 Update
A lot of users are experiencing problems where softwareupdate --install -a
will in fact not update to the newest version of Xcode. The cause for this is more than likely a pending macOS update (as @brianlmerritt pointed out below). In most cases updating macOS first will solve the problem and allow Xcode to be updated as well.
Updating the Xcode Command Line Tools
A large portion of users are landing on this answer in an attempt to update the Xcode Command Line Tools. The easiest way to achieve this is by removing the old version of the tools, and installing the new one.
A popup will appear and guide you through the rest of the process.
The Answer 2
I had the same issue and I solved by doing the following:
- removing the old tools (
$ sudo rm -rf /Library/Developer/CommandLineTools
) - install xcode command line tools again (
$ xcode-select --install
).
After these steps you will see a pop to install the new version of the tools.
The Answer 3
I encountered the same issue when I uninstalled the complete version of Xcode to reinstall the CLI version. My fix was:
sudo xcode-select -s /Library/Developer/CommandLineTools
The Answer 4
Just type the commands
Reference: https://forums.developer.apple.com/thread/104296
The Answer 5
I got this error after deleting Xcode. I fixed it by resetting the command line tools path with sudo xcode-select -r
.
Before:
After:
The Answer 6
After installing Command Line Tools (with xcode-select --install
), type:
You should be able to run git now:
The Answer 7
The Answer 8
Xcode::Install is a simple cli software that allow you to install/select a specific Xcode version.
You can install it using gem install xcode-install
Then you will be able to install a specific version with xcversion install 9.4.1
And if you have more than one version installed, you can switch version with xcversion select 9.4
You can find more information at https://github.com/KrauseFx/xcode-install
The Answer 9
@Vel Genov’s answer is correct, except when the version of Xcode can’t be updated because it is the latest version for your current version of Mac OS. If you know there is a newer Xcode (for example, it won’t load an app onto a device with a recent version of iOS) then it’s necessary to first upgrade Mac OS.
Further note for those like me with old Mac Pro 5.1. Upgrading to Mojave required installing the metal gpu (Sapphire AMD Radeon RX 560 in my case) but make sure only HDMI monitor is installed (not 4K! 1080 only). Only then did install Mojave say firmware update required and shut computer down. Long 2 minute power button hold and it all upgraded fine after that!
Catalina update – softwareupdate --install -a
won’t upgrade xcode from command line if there is a pending update (say you selected update xcode overnight)
The Answer 10
I was trying to use the React-Native Expo app with create-react-native-app but for some reason it would launch my simulator and just hang without loading the app. The above answer by ipinak above reset the Xcode CLI tools because attempting to update to most recent Xcode CLI was not working. the two commands are:
This process take time because of the download.I am leaving this here for any other would be searches for this specific React-Native Expo fix.
The Answer 11
Hello I solved it like this:
Install Application> Xcode.app> Contents> Resources> Packages> XcodeSystemResources.pkg.
The Answer 12
I was facing the same problem, resolved it by using the following command.
sudo xcode-select -s /Library/Developer/CommandLineTools
After running the above command then xcode-select -p command showed the following.
/Library/Developer/CommandLineTools
The Answer 13
xCode version 11.2.1 is necessary for building app in iPad 13.2.3, When I directly try to upgrade from xcode 11.1 to 11.2.1 through App Store it get struck, So after some research , I found a solution to upgrade by removing the existing xcode from the system
So here I am adding the steps to upgrade after uninstalling existing xcode.
- Go to Applications and identify Xcode and drag it to trash.
- Empty trash to permenently delete Xcode.
- Now go to ~/Library/Developer/ folder and remove the contents completely Use sudo rm -rf ~/Library/Developer/ to avoid any permission issue while deleting
- Lastly remove any cache directory associated with xcode in the path ~/Library/Caches/com.apple.dt.Xcode sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
- After completing the above steps you can easly install xcode from App Store, which will install the current latest version of xcode
Note: Please take a backup of your existing projects before making the above changes
The Answer 14
To those having this issue after update to Catalina, just execute this command on your terminal
Xcode is the tool developers use to build apps for the Apple ecosystem – MacOS, iOS, and all things Apple.
This guide will walk you through how to successfully install Xcode onto your Mac, from start to finish.
Here are some handy tips to know before you get started:
- Xcode only runs on a mac. If you are on a PC, sadly you won't be able to use Xcode.
- You'll need a good, stable internet connection. The latest version is around 8 gigabytes in size.
- Be sure to have at least 30 gigabytes of free space on your computer. The latest
.xip
file (v11.4.1 at the time of writing) is ~8 gigabytes zipped. When you unzip it, that's another 17 gigabytes. Then you'll need the command line tool, which is yet another 1.5 gigabytes.
Here's an overview of the steps to install Xcode
- Download Xcode
- Install the command line tool
- Open the new version
- Delete files
Note that I have listed some Terminal commands in the steps below. These commands can be typed into your present working directory. This means that you don't need to navigate to any particular folder.
If you really want to, you can first type cd
before typing the commands in the below steps. This will return you back to the home folder.
Step #1: Download Xcode
There are two ways to do this. For the latest version and a theoretically 'easy' installation, you can use the App Store. I don't recommend this option.
I prefer to use the developer site. This comes with the bonus option of being able to download any version you'd like.
Option #1: Download via the App Store for the latest version (not my preferred option)
In theory, this should be a seamless and pain-free process. But if the installation fails for any reason on the last step, it is very hard to troubleshoot.
There are a few reasons for failure, and no easy way to know which is the underlying cause. If you do encounter a failure, you will need to re-download the entire file again each time you try to fix the failure. As the latest version is 8 gigabytes, I didn't much enjoy this approach.
Can't Install Xcode Command Line Tools Catalina
But if you're feeling brave, here are the steps:
- Open the App Store on your mac
- Sign in
- Search for Xcode
- Click install or update
Option 2: Download via the Developer site for a specific version (my preferred option)
- Head to the 'more' section of the Apple developer website
- Sign in with your iTunes account id
- Type in the version that you'd like, and download the
Xcode_x_x_x.xip
file. Keep in mind that Xcode 11.4.1 is 8 gigabytes, so this will take awhile depending on your internet connection. - Once the file is downloaded, click on
.xip
to extract it. Your laptop will extract it to the same folder you downloaded it to. This extraction process is automatic. You don't need to do anything more after you click on the.xip
file. This step will take a few minutes. - [Optional] Once extracted, rename the application to “Xcode11.x.x” if you are using multiple versions.
- Drag application to the Applications folder
- [Optional] Set the new Xcode version as the default. Open Terminal and type
sudo xcode-select -switch /Applications/Xcodex.x.x.app
. Replacex.x.x
with the version number. For example:Xcode11.4.1.app
. You will need to enter in your computer admin password. I'm pretty sure this will update the default Xcode version for all users on your computer, so best to check with other users first
Step #2: Install the command line tool (CLT)
If you have multiple users on your computer, you will need to update the CLT for each user.
Download .dmg
To update the CLT, go to app developer website and download the command line tool .dmg
.
If you have never installed Xcode before, you may be able to update with your Terminal by typing in xcode-select --install
instead of visiting the developer website.
But if you have an existing version of Xcode installed on your machine, you'll probably see this error:
This means you'll need to go to the developer website instead.
Installing the CLT
When the .dmg
has finished downloaded, double click the file to open it. This will open a little window that looks like this:
Double click the box and follow the prompts to install the CLT. It will take a few minutes to complete.
It may ask you at the end of the installation whether you want to move this to the trash bin. When it does this, it's talking about moving the .dmg
file to the trash bin. Since you should no longer need this file. I always say yes to this.
Step #3: Open Xcode
Open the Applications folder and open the new version of Xcode. If you renamed Xcode, make sure you open the correct application
Xcode may prompt you to install additional components. Click install. This will take a few minutes.
While it's installing, check that your default Xcode version is the one you just downloaded:
Catalina Install Xcode Command Line Tools
- Open Terminal
- Type
brew config
- You should see “CLT” and “Xcode” versions, as well as everything else. This should reflect the version that you have just downloaded. In my case, I downloaded Xcode 11.4.1.
Once the components are installed, Xcode will launch. You should be able to pick up your old projects and continue where you left off seamlessly*.
*Note that if you use any proxy tools, such as Charles, you will need to re-install those certificates in your simulator again.
If you encounter any errors while trying to build or run a project, check which device you are trying to launch. The new version may not remember the device you were using before. If so, click on the device and choose 'Add additional simulators' from the drop down menu to add the device you want.
Step #4. Delete the files
If you don't need the older versions of Xcode on your computer, you can uninstall them and get some hard drive space back.
You can also delete the .xip
file of the version you just downloaded, as well as the CLT.dmg
file.
Catalina Install Xcode Command Line Tools Free
That's everything. I hope this has helped you successfully install Xcode. Have fun with it!