How to install Xcode from xip file

Solution 1:

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.

Solution 2:

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

Solution 3:

Update: 17 May, 2020: Most easy way

- Download the specific Xcode version that you want [from here][1]
- 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

  • https://ladydebug.com/blog/2019/08/20/xcode-installation-from-xip-file/
  • https://www.freecodecamp.org/news/how-to-download-and-install-xcode/

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