ChatGPT解决这个技术问题 Extra ChatGPT

How to install Xcode from xip file

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 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?

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!
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 this is where you can download Xcode and other developer tools: developer.apple.com/download/more
@rraallvv To download with wget you would need to use the --load-cookies option. Get your cookies after signing into the developer account.

S
Shashank Agrawal

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.


How long is this supposed to take?
Well then. It took 8 hours for me.
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....
I confirm what wrote haykam. Expand Xcode from its xip file is ridiculously slow.
Nothing but most applications are kept in Applications. Xcode will work from any location.
Д
Дмитрий Васильев

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?
Is this faster than doubleclicking in Finder ?
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.
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
@DimitriKopriwa Please copy the extracted Xcode app in your current command prompt folder to /Applications
D
Divyesh_08

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

What is the point of converting it to a dmg? Why not just use the xip file?
I have tried that but when I tried to open the xip but it not worked, that's why I have converted it to dmg. If xip works for you than you can use it.
Option 2 in the free code camp link is pretty nice.
d
dose

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


This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
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?