I want to install xcode to deploy a cross platform flutter application but I cant find enough space for Xcode is there any alternative solutions to just installing it on the
@cseder you're a life saver!
Btw, If you are getting issues or takes a long long time in Mac Catalina to verify while doing step 5 /usr/bin/xcrun --find xcodebuild
just:
csrutil disable
<- will disable the verification of software download from the internetsudo reboot
And then you can open Xcode directly without doing any /usr/bin/xcrun --find xcodebuild
Note after you are able to run Xcode then make sure to Turn Off again and enable csrutil enable
in secure mode.
I see from the recent comments that some of you are experiencing problems with this solution using the latest versions of Xcode, running on macOS Catalina.
Until further notice, this answer is only valid for: Xcode versions <= 11.3
I will keep adding info towards the bottom of the answer if / when I figure things out!
As an alternative to just moving XCode to an external drive you could also clone your mac disc and move the whole operating system onto your external drive and make it bootable.
Things you need:
Install the cloning software, follow the instructions and you'll have a bootable external drive in less than an hour (depending on what you are cloning)
You now have a portable development disk which can be plugged in and booted from any modern mac (caveat, not actually tried this)
On first boot and usage of XCode, the Apple OS will perform some verification of apps, but once that is done you should be fine.
I have a 2018 mac-mini running Big Sur with only 128GB internal SSD. Every time I needed to upgrade XCode I had to delete all the simulators. Upgrading to Big Sur was even harder :-/
Performance?
The external drive (Samsung T5) is 3x quicker to write to than the cheap internal SSD that Apple use on the mac-mini. Read speeds are about the same according to BlackMagic. Overall, Flutter app builds on the external drive are about 10% quicker.
Here is what worked for me, not only for XCode, but for all of the apps.
Example:
cd /Applications ln -s "/Volumes/Extreme SSD/Applications/XCode.app" XCode.app
I have tried this on all applications on my Mac and it worked like a charm.
Advantages: - Less Headache. Copying XCode directory into external SSD might not work. I have done this, and weirdly enough, there was a directory loop and I ended up losing all my external SSD space.
- The application is installed in the way it should
Disadvantages: - You have to lose 12GB of for the installation of Mac
This is so far working for me like a charm.
I just installed Xcode 12.3 to /Applications then copied the .app to my external drive, then deleted the original. After that:
ln -s /Volumes/ExternalSSD/Applications/Xcode.app /Applications/Xcode.app
It took a while to launch for the first time, but subsequently it's now fine. MacOS 11.1, M1 2020 Air.
I found out a simpler solution. Create a new user on your Mac. Give administrator privileges(optional), set the home directory of the user account you just created to be an external hard drive. Then login to the new user and install Xcode at ~/Applications directory not /Applications. Then Xcode is installed on your external ssd. No problems using it so far for me! Hope it helps.
Edit: I forgot to mention I should download Xcode from developers website. Haven’t tried downloading from App Store.