Xcode 使用命令行手动添加模拟器 Xcode install Simulator from the command line

在 Xcode 中可以使用 Settings - Platforms 来下载和管理各种设备的模拟器。

Xcode 使用命令行手动添加模拟器 Xcode install Simulator from the command line_第1张图片

不过在很多时候,因为网络或者其他原因需要手动下载模拟器的 dmg 文件并且手动添加模拟器,可以使用如下命令来手动添加。

1. 去 Apple Developer 下载相应设备的 Xcode 和模拟器文件,这里以 Xcode 15.0 和 iOS 17 Simulator 为例;

2. 安装 Xcode_15_Release_Candidate.xip 到 Applications 目录;

3. 在 Terminal 中执行:

sudo xcode-select -s /Applications/Xcode.app

sudo xcodebuild -runFirstLaunch

sudo xcrun simctl runtime add "/Path/iOS_17_Simulator_Runtime_Release_Candidate.dmg"

4. 在 Xcode - Window - Devices and Simulators 添加相应版本的模拟器,同理可以以此方法添加其他设备的模拟器。

Xcode 使用命令行手动添加模拟器 Xcode install Simulator from the command line_第2张图片

你可能感兴趣的:(Apple,iOS,Swift,xcode,macos,apple,vision,pro,ios,swift,swiftui,iphone)