117

I am very new to macOS, I just need a mac with Xcode to compile my app. However, with macOS Sierra, I have a problem with my USB that is not working anymore (i can't plug my ipad pro)

Under OSX El Capitan my usb works great, but now the problem is that app store offer me to download the Xcode 8.3 only that can work only on Sierra (strange they offer you to download something not compatible with your system but doesn't matter, it's apple). so the only way i have is to download manually the Xcode 8.2.1

Now my question, how to install the Xcode_8.2.1.xip file I just downloaded? and in near future, if I need to update xcode (I guess downloading myself a new version), how will I do? Also where the preferences and configurations settings are saved? does these preferences will be lost on each update?

Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
zeus
  • 12,173
  • 9
  • 63
  • 184
  • Is there a way to do this in Windows? I don't have a Mac, but I know Swift, and want to keep my skills sharp. Thanks! – ProgrammingEnthusiast Sep 06 '17 at 01:32
  • Where did you download the xip file? I'm trying to find Xcode_9.0.1.xip to download it with wget or something similar. – rraallvv Oct 28 '17 at 23:16
  • @rraallvv this is where you can download Xcode and other developer tools: https://developer.apple.com/download/more/ – Wessam El Mahdy Dec 02 '17 at 23:07
  • @rraallvv To download with wget you would need to use the --load-cookies option. Get your cookies after signing into the developer account. – kojow7 Jan 16 '20 at 20:06

4 Answers4

151

Double-click the xip file and it will extract the Xcode application. Move Xcode to the Applications folder and you are good to go.

The App Store should present the Xcode update once you update to Sierra (macOS 10.12). If it doesn't you can download Xcode directly from the App Store. The preferences are stored in /Users/<username>/Library/Preferences and are not impacted by updating the version of Xcode or OS.

Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
wintermute
  • 1,626
  • 1
  • 11
  • 3
  • 7
    How long is this supposed to take? – bb216b3acfd8f72cbc8f899d4d6963 Jul 30 '17 at 09:51
  • depends on the Mac, it usually takes about 4 minutes or so on my MacBook Pro. – wintermute Jul 31 '17 at 13:27
  • 60
    Well then. It took 8 hours for me. – bb216b3acfd8f72cbc8f899d4d6963 Jul 31 '17 at 19:12
  • 43
    This *really* sucks. I made the mistake of allowing my iPad to upgrade to the new version of iOS... which of course means now, Xcode refuses to connect to it until I upgrade Xcode, which I can't do before I upgrade to the latest OS X. Hours of my day lost, due to the Apple's shortsightedness, and bad download speeds (which is why I was also trying to go via an .xip file, rather than the "Update" button). 2017, and Apple is still this hopeless.... – Mike Gledhill Aug 10 '17 at 12:03
  • [somewhat related](https://ericasadun.com/2016/03/22/xcode-upgrades-lessons-learned/) had the same experience and can recommend the xip approach: 6 hours vs. 2 hours. Still a lot, but less than a day of productivity lost. – Cee McSharpface Jul 03 '18 at 11:07
  • 11
    I confirm what wrote haykam. Expand Xcode from its xip file is ridiculously slow. – Stephane Piriou Jul 24 '18 at 11:30
  • "it will extract the Xcode application" — to where? I tried to extract manually from the archive utility but I was never asked for a destination... – Andreas Sep 14 '18 at 12:51
  • 1
    The application is extracted to the same folder as the xip file, if you double-click the xip file. Extracting manually does the same thing, the expanded file is in the same folder. – wintermute Sep 15 '18 at 13:22
  • What is the difference between keep the Xcode folder in the download folder and application folder? – Paul Sep 21 '18 at 16:54
  • 2
    Nothing but most applications are kept in Applications. Xcode will work from any location. – wintermute Sep 22 '18 at 20:31
  • 1
    Xcode 10.2 contains ~260000 files in ~100000 directories in ~15 GB. A lot of small files. Therefore, unpacking is so slow. – NikitaFeodonit Apr 28 '19 at 09:29
  • The application(Xcode.app) is extracted to ~/Downloads folder, instead of the folder that contains my 'Xcode.xip' file. – Lax Jun 04 '19 at 06:36
  • Where was the Xcode.xip file located before you extracted it? – wintermute Jun 05 '19 at 21:59
  • There is a script that update the device support files for this cases. https://github.com/iGhibli/iOS-DeviceSupport I used myself and it works. – Igor Nov 27 '19 at 17:35
  • Guys I have Xcode 10 now and I install Xcode 11 .xip file so should I delete previous Xcode before clicking on .xip file or it will replace the previous one with new Xcode 11? – Oliver D May 07 '20 at 17:40
  • The resulting Xcode will overwrite the older version. You can keep the older version, if desired, by renaming the application to something like Xcode10.app. – wintermute May 08 '20 at 18:27
  • What prevented Apple from going for gzipped tar files ? – Gunnar Forsgren - Mobimation Jun 27 '21 at 07:53
  • 1
    The xip format allows the file to be digitally signed and a gzipped tar file doesn't. – wintermute Jun 28 '21 at 22:04
52

For example, if a XIP file is located on your desktop: open the “Terminal” application found in /Applications/Utilities/ and run the following command:

 xip -x ~/Desktop/Xcode_8.2.1.xip
  • will the install xcode to applications directory or desktop directory? – Nitin Sawant Jul 20 '19 at 06:27
  • 1
    @NitinSawant It will extract it to the desktop directory – Jonas Deichelmann Aug 05 '19 at 09:01
  • 22
    Is this faster than doubleclicking in Finder ? – bobmoff Oct 17 '19 at 06:42
  • @bobmoff doubleclicking in some cases can launch other associated app and will not take expected result – Дмитрий Васильев Jan 22 '20 at 12:50
  • 7
    I double click and it open with The Archire Ultilities / The Unarchiver ==> So slow and failure! Use `xip` command is faster that double click, and it's only way to make it work on my low diskspace machine. Noted that the extracted file is located at your current command prompt folder. – Neo.Mxn0 Jul 01 '20 at 09:34
  • 5
    It gives me `xip: signing certificate was "Development Update" (validation not attempted)` and hang for about 8min and then, after this command, I do not have a `/Applications/Xcode.app/ ` directory – Dimitri Kopriwa Aug 26 '20 at 13:33
  • 1
    I had after 14 minutes `xip: expanded items from "/Users/user/Downloads/xcode.xip"` @DimitriKopriwa – barwnikk Aug 24 '21 at 03:06
  • 1
    @DimitriKopriwa Please copy the extracted Xcode app in your current command prompt folder to /Applications – Nam Vu Oct 14 '21 at 17:53
  • 1
    `xip` is much faster than double-clicking to open. Someone investigated why: https://twitter.com/_saagarjha/status/1481353292164698112 – Ryan Tarpine May 23 '22 at 15:23
  • I am using a Macbook Air M1 2021 base model with 8 GB RAM. I downloaded the latest version of Xcode 13.4.1 and used this command to install it. It took around 8 minutes to extract it into the folder, after that just move the app to the application folder and run it. It will verify your installation and start Xcode. – Georgi Yanev Jun 26 '22 at 14:25
28

Update: 17 May, 2020: Most easy way

  • Download the specific Xcode version that you want from here
  • Add the downloaded Xcode.xip in Applications
  • Double click on it, it will start expand. It will take some time.
  • If you have multiple Xcode version like 12.0, 12.1 in Applications rename it accordingly.
  • Double click on extracted Xcode version and install tools.
  • To set default Xcode version run this command:
sudo xcode-select -switch /Applications/Xcode_12.1.app
  • To check default Xcode version in your system use this command:
/usr/bin/xcodebuild -version

Note: Set default xcode step can be skip if you don't have multiple xcode versions in Applications.

Update: 08 Oct, 2020: Easy way

Old Ans

Convert the xip to a dmg by opening a terminal to the folder where the xip is placed and run the following commands:

open Xcode_X_Y_Z.xip
mkdir Xcode-tmp
mv Xcode.app Xcode-tmp/Xcode.app
hdiutil create -volname "Xcode" \
    -srcfolder Xcode-tmp \
    -ov -format UDZO \
    Xcode_X.Y.Z.dmg
rm -rf Xcode-tmp
shreyasm-dev
  • 2,711
  • 5
  • 16
  • 34
Divyesh
  • 2,085
  • 20
  • 35
3

xip -x Xcode_12.4.xip command won't install under /Applications/Utilities

/Applications/Utilities requires sudo permission. So, you should run like: sudo xip -x /tmp/Xcode_12.4.xip under /Applications/Utilities path

dose
  • 43
  • 1
  • 3
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32178965) – Japhei Jul 09 '22 at 20:08
  • How do we run `sudo xip -x /tmp/Xcode_12.4.xip` under `Applications/Utilities` path though. Do you mean, we should copy the .xip file to `Applications/Utilities` and run it from there? – Qasim Jul 10 '22 at 05:30
  • In terminal, enter 'cd /Applications/Utilities' then 'sudo xip -x /tmp/Xcode_12.4.xip'. However on my side, the Xcode.app file is in /Applications directly... – Christophe May 13 '23 at 20:49