
Download and install iOS simulator runtime using xcodebuild
This article was published more than one year ago. Please be aware that the information may be outdated.
This page has been translated by machine translation. View original
Since Xcode 16.0, it's possible to download and install iOS simulator runtimes using xcodebuild.
According to Apple's documentation "Installing and managing Simulator runtimes", simulator runtimes were previously available for download from Apple Developer, but in the future, they will no longer be provided from the website. Therefore, it's now recommended to use commands to download and install runtimes.
Once a runtime is downloaded, the cache will be used for subsequent downloads, making them much faster. This mechanism was likely introduced to reduce the load on Apple's servers.
This article will explain in detail how to download and install iOS simulator runtimes.
How to download iOS simulator runtimes
For Xcode 16.0
In Xcode 16.0, you can download the latest iOS simulator runtime using xcodebuild -downloadPlatform iOS -exportPath <path>.
xcodebuild -downloadPlatform iOS -exportPath ./SimulatorRuntimes/
When this command is executed, the latest iOS simulator runtime will be downloaded to the specified path.
For Xcode 16.1 and later
In Xcode 16.1 and later, you can use xcodebuild -downloadPlatform <platform> -exportPath <path> [-buildVersion <specific-version>] with the -buildVersion option to get a specific version of the runtime.
xcodebuild -downloadPlatform iOS -buildVersion 18.1 -exportPath ./SimulatorRuntimes/
xcodebuild -downloadPlatform iOS -buildVersion 22A3351 -exportPath ./SimulatorRuntimes/
How to install iOS simulator runtimes
To install the downloaded iOS simulator runtime, use xcodebuild -importPlatform <path/simruntime.dmg>.
xcodebuild -importPlatform ./SimulatorRuntimes/iphonesimulator_22A3351.dmg
Before running this command, make sure the downloaded runtime is saved in the correct path.
References


