tl;dr: You are only going to need round about 45G on the external SSD. My solution is to unpack the .xip file containing Xcode manually there and run it.
Post
Replies
Boosts
Views
Activity
It took me a week, barking up the wrong three a lot, but I did it, an here is how:
My premesis: A MacBook Pro 2017 with less than 10G space left
An Ubuntu 20.20 with plenty of space
An external 1TB SSD formatted with HFS+ and named "SSD"
Start with your Mac.
At first download Xcode from:
https://developer.apple.com/download/more/?q=xcode
directly to your external disk, changing the download location in the Safari preferences. I have chosen v12.0.1.
Go to terminal an change directory to the mount point of your external drive.
On your Mac now unpack the .xip file using:
xar -xf Xcode_12.0.1 /Volumes/SSD/
This is going to give you a folder named "Xcode_12.0.1" with two files inside: Metadata and Content.
Now switch to Ubuntu.
Download the files from this repository:
https://github.com/NiklasRosenstein/pbzx/blob/master/pbzx.c
To compile it, I needed to download and install some old libraries from Ubuntu 14.10 on my Ubuntu 20.20.
I can provide more Information about this if needed, but mainly it is about the following libraries and packages:
libxar-1.6.1-alt3.x86_64
libxar-dev_0.7r1785-5ubuntu2_amd64
xar-1.6.1
libpng12-0_1.2.50-2+deb8u3_amd64
libwxgtk2.8-0_2.8.12.1+dfsg-2ubuntu2_amd64
libwxbase2.8-0_2.8.12.1+dfsg-2ubuntu2_amd64
I also had to look for the xar.h I found somewhere I don't remember.
To make it easier I forked and uploaded the resources and a compiled version to:
https://github.com/FolkertsHeiko/pbzx
Sure you have to trust me, but you can. I promise ;-).
If you want to do it yourself, here is the gcc command line, but do not expect it to work out of the box:
gcc pbzx.c /usr/lib/libxar.so -lxar -llzma -o pbzx
To mount the external volume you sure going to need the hfsprogs package:
sudo apt-get install hfsprogs
Next, mount or remount the HFS+ drive:
sudo mount -t hfsplus -o force,rw /dev/sdXY /media/mntpoint
or
sudo mount -t hfsplus -o remount,force,rw /mount/point
Now decompress the Content file with the self-compiled pbzx binary, both mentioned above, and unpack it with cpio, which already was installed on my Ubuntu System:
pbzx -n /media/heiko/SSD/Xcode_12.0.1/Content | cpio -i
This will give you another folder in your current working directory, named Xcode.app
Go back to your Mac and link the Xcode-Application:
cd /Applications
sudo ln -s /Volumes/SSD/Xcode.app/ .
Now run it with Finder, which is going to take a while for the first start.
After that, Xcode should run from your external drive.
I hope this is helpful.
Happy coding,
Heiko.
Edit: Typos
Have a look here:
https://developer.apple.com/forums/thread/110533?login=true&page=1#641207022