Download Xcode by wget

I was trying to download Xcode via direct link of apple using Google chrome. But it was failing once and again and showing below error after some downloads.


This is typical google chrome issue with large files and unfortunately Xcode.xip is a huge file (about 7.1 GB) and takes a lot of time. I wasted my hours on this silly issue.

I thought to use another solution for this problem. If you are suffering from the same issue, use below solution and it works.

Download Xcode viawget

1- Install the home-brew

Open Terminal Run

  /usr/bin/ruby -e "$(curl -fsSL"

2- install wget

Run below command in terminal to install wget

 brew install wget

3- Install and get cookies.txt from google chrome

Cookies.txt is an extension of google chrome that save the download link of page in .txt format. Remember, it provides different text on every link Install the cookies extension from below link

Click on cookies extension icon and download the text file in downloads

Open the developer site from below link

Or get the download link of Xcode from below link

Update the file by using below.(it’s for Xcode 11 beta ,you can change according to your Xcode download link)

 1) wget -x --load-cookies cookies.txt ""

 2) curl --cookie cookies.txt ""

3) aria2c --load-cookies cookies.txt ""

6- Run wget file from terminal

Open terminal and navigate to download

Run below command for Xcode 11 or change according to your link

 wget --load-cookies=cookies.txt -c