Speed up Xcode additional simulator download
So I had to download an additional simulator for testing my app on different iOS environments and even though I have 100Mbps internet it was taking ages to download and I found Xcode doesn’t support concurrent downloads.
Advantages of using my way to download simulators:
1. You get resumable downloads! So even if your Mac went to sleep, you don’t need to start again with 0 bytes! 💪🏼
2. Multi-Connection download: You get to use n number of ports, which results in a much faster download 🔥
3. You can transfer the downloaded simulator to a USB storage and use it only when required. Saves you your precious disk space 😎
So how we do it?
1. Install aria2, it is is a lightweight multi-protocol & multi-source command-line download utility.$ brew install aria2
2. Launch your Xcode using terminal$ /Applications/Xcode.app/Contents/MacOS/Xcode
3. Start your simulator download. Xcode -> Preferences -> Components
4. Once the download starts, cancel it!
5. Check your terminal, there will be a message like this:2022–01–10 10:42:18.873 Xcode[15877:4336055] DVTDownloadable: Download Cancelled. Downloadable: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK14_0-14.0.1.1604100028.dmg.
6. Quit Xcode$ ctrl + c
7. Copy the URL to dmg
8. Download using aria, x5 specifies 5 ports to download, you can change the no. to best suit you. Don’t be afraid to cancel the download and try with different ports, you have resume capability!$ aria2c -x5 https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK14_0-14.0.1.1604100028.dmg
How to install this dmg?
1. Copy the downloaded file to ~/Library/Caches/com.apple.dt.Xcode/Downloads
2. Go to the downloads section in Xcode and start the simulator download again, it will find the existing file and install it.
Happy testing! ❤️