Gleb
Gleb

Reputation: 176

How to change iOS simulator directory

Xcode takes a lot of free space on my SSD therefore I installed it on my external HDD. But when I tried to download any of iOS simulators in Xcode preference I noticed that it was still downloaded on my SSD. Could you please tell how can I change iOS simulator directory? In terminal, anywhere else?

I tried to find command line combination, which change path to simulator

I expected that iOS simulators will get downloaded to my external hdd and would work well

Upvotes: 5

Views: 2523

Answers (1)

Jeremy Huddleston Sequoia
Jeremy Huddleston Sequoia

Reputation: 23641

As of Xcode 11 (released to beta to developers yesterday), we should locate the simulator runtimes located in /Volumes/*/Library/Developer/CoreSimulator/Profiles/Runtimes

I suggest you move them to that location on your spare drive. Doing so while CoreSimulatorService is running will probably confuse its state because we don't currently handle runtimes vanishing from the root filesystem (we do handle them disappearing due to a disk eject through), so you will probably need to SIGKILL CoreSimulatorService after doing the move by running:

sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService 2> /dev/null

If you don't want to wait for Xcode 11, you can also just create a symlink from /Library/Developer/CoreSimulator/Profiles to /Volumes/MyHDD/Library/Developer/CoreSimulator/Profiles.

Upvotes: 4

Related Questions