Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NicholasTD07/3ffbaee9973ae06b5a12 to your computer and use it in GitHub Desktop.
Save NicholasTD07/3ffbaee9973ae06b5a12 to your computer and use it in GitHub Desktop.
How to Download iOS Simulator (Xcode) in Command Line and Install it

How to Download iOS Simulator (Xcode) in Command Line and Install it

For faster connection speed and more flexibility.

Steps

  1. Start Xcode in command line by running this in commandline /Applications/Xcode.app/Contents/MacOS/Xcode
  2. Start downloading of the simulator
  3. Cancel it. YES CANCEL IT!
  4. You will get a message like this: 2015-11-23 17:10:01.906 Xcode[30803:2505495] DVTDownloadable: Download Cancelled. Downloadable: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK8_3-8.3.1.1428621365.dmg.
  5. Quit Xcode
  6. Use your favorite download tool with the link in that message in step 3
  • This is what I use: (5 concurrent connection) aria2c -x 5 link_to_the_file
  1. Have Fun!

Wait! How can I install this?

By moving the file to ~/Library/Caches/com.apple.dt.Xcode/Downloads

  • You can use Finder by open ~/Library/Caches/com.apple.dt.Xcode/Downloads
  • Or just mv file ~/Library/Caches/com.apple.dt.Xcode/Downloads

And open the Downloads tab in Xcode's Preferences,

  • the progress bar of the item you just download should be 80% filled
  • you should be able to click that download button to install the file

Why did I need it?

I am in China right now and when downloading in Xcode(no concurrent downloading), the download speed sucks! I would like to use aria2 to speed up the downloading process of the simulator(s).

How slow was the connect using Xcode and how fast was it when using aria2?

  • Xcode: 150KB -> 300KB
  • aria2: 2.7MB (consistenly), which is the maximum downloading speed of my cable

Why aria2?

  • Concurrent connections
  • Resuming unfinished downloads

References

@andr-ec
Copy link

andr-ec commented Oct 5, 2021

Preferences > Components > Simulators ( if not already selected) > Download button for the simulator you want.
Should start out 80% filled as well.

@maxtomczyk
Copy link

Just create Downloads catalog, worked for me :)

@SuperNova911
Copy link

You saved my life

@HomyeeKing
Copy link

hey, just a few questions:
after download the dmg and move it to the Xcode download folder, is that just help us finish 80% not all of the downloading?
the remain 20% still slow..

@SuperNova911
Copy link

hey, just a few questions: after download the dmg and move it to the Xcode download folder, is that just help us finish 80% not all of the downloading? the remain 20% still slow..

Last 20% is kind of decompressed and the installation process, and it takes some time

@bigyank
Copy link

bigyank commented Sep 14, 2022

My download progress is not showing 80% after doing all the steps above, can someone help me please, my xcode version is 13.3.1 (13E500a)
Edit: I had to create the Downloads folder first, and then it worked

@PhiFry
Copy link

PhiFry commented Jan 5, 2023

For me on MacOS 12.6 and XCode 14.1 I downloaded the .dmg according to the instructions (I didnt use aria2 I simply pasted the link into Chrome), however, for me there were no Downloads folder inside ~/Library/Caches/com.apple.dt.Xcode so I had to create it myself and then move the .dmg into it.

When I started XCode and opened Preferences there were no Downloads tab but going to Platforms and adding the iOS version I just downloaded again started to install it from the .dmg I had just moved into the downloads folder.

Thanks a lot! Saved me hours.

@kirti-swiggy
Copy link

Does not work with iOS 16+ simulator runtimes.

@giftbalogun
Copy link

Thanks so much.

@Tayphoon
Copy link

Tayphoon commented Aug 16, 2023

You can add runtime from terminal using command:
xcrun simctl runtime add
When just run xcode and add new simulator
https://developer.apple.com/documentation/xcode/installing-additional-simulator-runtimes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment