6

I want to install Xcode in my MacBook Air OSX 10.8.3. The issue is my MacBook Harddisk is just 64GB and it's almost full. I have an external HDD (Formatted to MAC partition) and how can I install Xcode to this HDD? Because when I am trying to install Xcode I am getting an error there is no sufficient memory available.

Thanks.

8

I recently moved my Xcode (4.6.2) from /Applications to /Users/daniel/Applications (I'm getting ready to slim down the main system partition to use an iSCSI target for my home folder, and want as much on it as possible).

The link in the comment by Buscar above isn't valid for new Xcodes that come through App Store. Instead, just move the app using Finder. You'll probably be asked to supply your credentials (due to admin permissions on some of the files inside Xcode.app).

You'll notice at first that Xcode starts up as if nothing happened. All seems to be well, but isn't quite, though — your Command Line Tools will be fudged. Other stuff that depend on it, like Homebrew, will fail unless you do this:

In Xcode, open Preferences and go to the "Locations" tab. The dropdown labeled "Command Line Tools" will be blank and there'll be a warning sign next to it.

Simply select the Xcode in that dropdown, and after once again supplying your credentials, all is well :) Even updates will perform as expected (I updated to 4.6.3 with no issues).

| improve this answer | |
0

An idea:

  1. Move some of your data to your external HDD to free up some disk space temporarily.
  2. Install Xcode (to your internal HDD).
  3. Move the Xcode application to your external HDD (I believe it is OK to relocate recent versions of Xcode by dragging it in the Finder, since it is now a self-contained application).
  4. Move your data back to your internal HDD again.
| improve this answer | |
0

There are various possible solutions, including, making use of symlinks, dual booting two versions of macOS (one on external SSD), and many more.

But the best way I found was to create a new macOS user and change its home directory to external SSD (by going to advanced user settings under Users & Groups System Preferences).

The exact steps I followed:

  1. Create a new APFS partition on external SSD with 100GB storage. (say NewVol)

  2. Create new macOS user and change its home directory to /Volume/NewVol/user

  3. Logged into the new user with external SSD connected, and installed xcode in ~/Application. (i.e. the local Application folder, not /Application)

Why this works best is because you don't need to manually manage symlinks, also symlinks might create problems during builds. All the required files (including builds and temporary files) are stored in user directory, so no space occupied on internal drive. Also, no hassle of installing a complete separate OS, and going through cycles of reboots to switch the OS.

| improve this answer | |
  • Also note that external SSDs are slower than internal ones present in MacBook. (Eg: r/w 500/400 MBPS vs 1200/500 MBPS), so opening xcode or other applications on the new user will be a bit slower (maybe not noticeable). – Anirudh Gupta Jan 25 at 7:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .