Xcode 16.1 beta2 的更新日志有一段说明:
The simulator runtimes are currently available on the Apple Developer website, but will no longer be posted through the website in future updates. Please use xcodebuild -downloadPlatform -exportPath command to download the runtime and then xcodebuild -importPlatform <path/simruntime.dmg> to install it. For more details, see Installing and managing Simulator runtimes. (133776444)
以后不在网站上提供 Simulator Runtime
的下载链接了,需要使用 xcodebuild
来下载:
$ xcodebuild -downloadPlatform iOS -exportPath 'Simulator Runtime'
$ xcodebuild -downloadPlatform tvOS -exportPath 'Simulator Runtime'
$ xcodebuild -downloadPlatform watchOS -exportPath 'Simulator Runtime'
$ xcodebuild -downloadPlatform visionOS -exportPath 'Simulator Runtime'
因为 Simulator Runtime
同时也包含了对应平台的 SDK,所以基本上是需要全部下载回来的。
安装 Simulator Runtime
:
Xcode 16 开始,使用 xcodebuild
:
$ xcodebuild -importPlatform "~/Downloads/iOS Simulator Runtime.dmg"
Xcode 16.1 beta 3 开始支持 -buildVersion
指定下载特定系统版本的 Runtime:
$ xcodebuild -downloadPlatform iOS -buildVersion 16.0 -exportPath ./SimRuntimeImages/
$ xcodebuild -downloadPlatform iOS -buildVersion 20A360 -exportPath ./SimRuntimeImages/
如果是 Xcode 15 以及之前的版本,使用 xcrun
:
$ xcrun simctl runtime add "~/Downloads/iOS Simulator Runtime.dmg"