Can I install Xcode on an external hard drive along with the iPhone Simulator.app?

后端 未结 6 697
天涯浪人
天涯浪人 2020-12-22 20:05

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

相关标签:
6条回答
  • 2020-12-22 20:49

    @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:

    1. Turn off the computer
    2. Turn on, and quick enter in Secure mode (Press CMD + R multiple times)
    3. Login to your account and open the terminal once Secure mode is on
    4. Run this command csrutil disable <- will disable the verification of software download from the internet
    5. Run sudo 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.

    0 讨论(0)
  • 2020-12-22 20:56

    PLEASE READ THIS FIRST!

    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!

    0 讨论(0)
  • 2020-12-22 20:56

    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:

    • A large, fast external SSD, such as the Samsung X5 Thunderbolt 3 drive.
    • A Mac disk cloner (e.g. Carbon Copy Cloner beta for Big Sur, or SuperDuper!)

    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.

    0 讨论(0)
  • 2020-12-22 20:56

    Here is what worked for me, not only for XCode, but for all of the apps.

    1. Install MacOS into the external media (SSD would be better).
    2. You need to enable booting from an external drive. You do that by Pressing Command and R right after you see the apple sign after reboot
    3. Once you have MacOS installed on the external media, install any application you want. WhatsApp, XCode, IntelliJ, Adobe Photoshop ...etc
    4. Once you are done, change the boot settings, to boot from the MacMini or Macbook pro drive.
    5. Create symbolic links to the apps you installed on your external drive

    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.

    0 讨论(0)
  • 2020-12-22 21:04

    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.

    0 讨论(0)
  • 2020-12-22 21:05

    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.

    0 讨论(0)
提交回复
热议问题