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

@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