Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save toru173/3e9837196235f28fd17cbd81255740b8 to your computer and use it in GitHub Desktop.
Save toru173/3e9837196235f28fd17cbd81255740b8 to your computer and use it in GitHub Desktop.

The issue encountered is that Xcode is downloadable from Apple's Developer Portal (https://developer.apple.com/download/all/?q=xcode); however, it is an extremely large xip file archive, approximately 12GB in size. The archive request 32GB of free space in order to extract the app even though the final file size is smaller than this. Editing the Metadata file contained within the Xip archive to request less space results in a failed signature check (as expected). Thus, the easiest thing to do is to move the file off the main disk and extract it, then move the extracted files back. One way to do this - provided there is sufficient RAM - is to copy the installer to a 12GB RAM disk and then extract it to /Applications. Note that the xip utility extracts the file to the current working directory. Thus, we can do the following:

hdiutil attach -nobrowse -nomount ram://25165824
diskutil erasevolume HFS+ 'RAM Disk' /dev/diskX
mv ~/Downloads/Xcode_VERSION.xip /Volumes/RAM\ Disk/
cd /Applications
xip --expand /Volumes/RAM\ Disk/Xcode_VERSION.xip
hdiutil eject /dev/diskX
@toru173
Copy link
Author

toru173 commented Apr 11, 2022

Just promoted this to a Repository, available at https://github.com/toru173/Install-Xcode-from-a-RAM-disk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment