生成时间:2026-07-21 源机器环境:Xcode 26.3 · macOS 26.1 · Apple Silicon (arm64)
目录
核心概念
模拟器由两部分组成,迁移时需区分:
| 概念 | 说明 | 典型大小 | 能否单独拷贝 |
|------|------|----------|-------------|
| Runtime(系统镜像) | iOS 操作系统本身 | ~8 GB(dmg)/ ~16 GB(挂载后) | ✅ 可以 |
| Device(模拟器实例) | 某台 iPhone 的配置、App 及数据 | 几百 MB ~ 几 GB | ✅ 可以,但依赖 Runtime |
⚠️ 只拷贝 Device 文件夹,目标 Mac 上没有对应 iOS 版本 Runtime,模拟器无法启动。
本机环境一览
Xcode 26.3 (Build 17C529)
macOS 26.1 · arm64
已安装 Runtime(3 个,共 24.3 GB,状态均为 Ready):
├── iOS 26.3.1 (23D8133) ← 仅 arm64
├── iOS 18.6 (22G86) ← x86_64 + arm64
└── iOS 18.4 (22E238) ← x86_64 + arm64
iOS 26.3 可用设备示例:
iPhone 17 Pro / iPhone 17 Pro Max / iPhone Air / iPhone 17
iPhone 16 Pro / iPhone 16 Pro Max / iPhone 16e / iPhone 16 Plus
iPhone SE (3rd generation)
iPad Pro 11/13-inch (M5/M4) / iPad Air / iPad mini 等
模拟器实例:54 个,占用约 1.5 GB
路径:~/Library/Developer/CoreSimulator/Devices/
下载 iOS 26 模拟器
方法一:Xcode 图形界面(推荐)
-
打开 Xcode
-
进入 Xcode → Settings → Platforms(旧版为 Components)
-
找到 iOS 26.x,点击下载
方法二:命令行
# 下载最新 iOS 模拟器 Runtime
xcodebuild -downloadPlatform iOS
# 查看已安装的 Runtime
xcrun simctl runtime list
# 查看可用模拟器设备
xcrun simctl list devices available
# 查看 Runtime 详情(含文件路径,JSON 格式)
xcrun simctl runtime list -j | python3 -m json.tool
前提条件
| 条件 | 要求 |
|------|------|
| Xcode 版本 | 26.x(iOS 26 模拟器需对应 Xcode) |
| 芯片 | Apple Silicon (M 系列) — iOS 26.3 仅支持 arm64 |
| macOS | 满足 Xcode 26 最低系统要求 |
| 网络 | 需连接 Apple 服务器,单次下载约 8 GB |
| 磁盘 | 至少预留 10 GB 空闲空间 |
离线拷贝 Runtime 到另一台 Mac
适用场景:内网多台 Mac、下载慢、无法访问 Apple 服务器。
第一步:在源 Mac 导出 .dmg
# 1. 关闭所有模拟器
xcrun simctl shutdown all
# 2. 查看 Runtime 路径
xcrun simctl runtime list -j | python3 -m json.tool
本机 iOS 26.3.1 源文件路径:
/System/Library/AssetsV2/com_apple_MobileAsset_iOSSimulatorRuntime/c6f07ed8ec1586ca140801a2c7c60f478e947602.asset/AssetData/Restore/094-26194-058.dmg
文件大小:约 7.8 GB
# 3. 拷贝 dmg 到桌面或外置存储(需要 sudo)
sudo cp \
"/System/Library/AssetsV2/com_apple_MobileAsset_iOSSimulatorRuntime/c6f07ed8ec1586ca140801a2c7c60f478e947602.asset/AssetData/Restore/094-26194-058.dmg" \
~/Desktop/iOS_26.3.1_23D8133.dmg
本机 iOS 18.x 源文件路径(Cryptex 目录):
/Library/Developer/CoreSimulator/Cryptex/Images/bundle/
SimRuntimeBundle-4495EA20-573C-4571-A879-AF4789B67092/Restore/043-19278-100.dmg # iOS 18.6
SimRuntimeBundle-E48FA943-87E8-486E-B095-AF409AEFD364/Restore/090-44334-323.dmg # iOS 18.4
传输方式:U 盘、移动硬盘、AirDrop、内网共享均可。
第二步:在目标 Mac 导入
目标 Mac 需先安装 Xcode 26.x(仅装 Command Line Tools 不够)。
# 导入 Runtime(自动校验 Apple 签名并挂载)
sudo xcrun simctl runtime add ~/Desktop/iOS_26.3.1_23D8133.dmg
# 导入成功后删除源文件(节省空间,适合 U 盘场景)
sudo xcrun simctl runtime add ~/Desktop/iOS_26.3.1_23D8133.dmg -m
# 验证导入结果
xcrun simctl runtime list
xcrun simctl list runtimes
# 若 Xcode 中看不到,执行扫描
sudo xcrun simctl runtime scan-and-mount
导入成功后,在 Xcode → Settings → Platforms 中可见 iOS 26.3,并可创建模拟器设备。
离线拷贝限制
| 限制 | 说明 |
|------|------|
| Xcode 版本 | 目标 Mac 需 Xcode 26.x |
| 芯片架构 | iOS 26.3 仅 arm64,Intel Mac 不支持 |
| macOS 版本 | 目标 macOS 需满足 Xcode 26 要求 |
| 签名验证 | dmg 必须是 Apple 官方签名,simctl runtime add 会自动校验 |
| 跨大版本 | iOS 18 Runtime 不能用于 Xcode 14 等旧版本 |
拷贝模拟器实例(含 App 数据)
若需迁移已配置好的模拟器(安装了 App、有登录态、有测试数据):
源 Mac
# 1. 关闭所有模拟器
xcrun simctl shutdown all
# 2. 查看目标设备 UDID
xcrun simctl list devices
# 3. 拷贝设备实例(以 iPhone 17 Pro 为例)
cp -R \
~/Library/Developer/CoreSimulator/Devices/<UDID> \
/path/to/external/iPhone17Pro_backup
目标 Mac
# 1. 确认已有对应 iOS 版本 Runtime
xcrun simctl runtime list
# 2. 拷入 Devices 目录
cp -R \
/path/to/external/iPhone17Pro_backup \
~/Library/Developer/CoreSimulator/Devices/<UDID>
# 3. 重启 CoreSimulator 服务
killall -9 com.apple.CoreSimulator.CoreSimulatorService 2>/dev/null
# 4. 验证
xcrun simctl list devices
注意: 若 UDID 冲突,建议在目标 Mac 用
xcrun simctl create新建设备,再只迁移data/目录内的 App 数据。
新建模拟器设备(目标 Mac 无对应实例时)
# 查看可用设备类型和 Runtime
xcrun simctl list devicetypes
xcrun simctl list runtimes
# 创建 iPhone 17 Pro(iOS 26.3)
xcrun simctl create "My iPhone 17 Pro" \
"com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro" \
"com.apple.CoreSimulator.SimRuntime.iOS-26-3"
simctl runtime 命令参考
⚠️
simctl没有 export 命令,导出需手动拷贝.dmg文件。
# ── 查看 ──
xcrun simctl runtime list # 列出所有 Runtime
xcrun simctl runtime list -j # JSON 格式(含路径、UUID、大小)
xcrun simctl runtime list -v # 详细信息
# ── 导入 ──
sudo xcrun simctl runtime add <path> # 导入 dmg
sudo xcrun simctl runtime add <path> -m # 导入后删除源文件
sudo xcrun simctl runtime add <path> -a # 异步导入,立即返回 UUID
sudo xcrun simctl runtime scan-and-mount # 扫描并挂载遗漏的 Runtime
# ── 删除 ──
sudo xcrun simctl runtime delete <UUID> # 删除指定 Runtime
sudo xcrun simctl runtime delete all # 删除所有 Runtime
sudo xcrun simctl runtime delete --notUsedSinceDays 30 # 删除 30 天未使用的
# ── 校验 ──
sudo xcrun simctl runtime verify <UUID> # 重新校验签名
# ── SDK 匹配(Beta 期间多个 build 时有用)──
xcrun simctl runtime match list # 查看 SDK → Runtime 映射规则
xcrun simctl runtime match set <sdk> <build> # 手动指定优先 Runtime build
磁盘占用参考
| Runtime | 原始 .dmg | 挂载后 Volume | 架构 |
|---------|-----------|--------------|------|
| iOS 26.3.1 (23D8133) | 7.8 GB | 16 GB | arm64 only |
| iOS 18.6 (22G86) | ~8.2 GB | 19 GB | x86_64 + arm64 |
| iOS 18.4 (22E238) | ~8.2 GB | 18 GB | x86_64 + arm64 |
| 合计(3 个) | ~24.3 GB | ~53 GB | — |
| 模拟器实例 (Devices/) | — | 1.5 GB(54 个) | — |
离线迁移建议:
-
拷贝 dmg 源文件(~8 GB)比拷贝挂载 Volume(~16 GB)更省空间
-
U 盘/目标 Mac 至少预留 10 GB
-
三台 Runtime 全部迁移需约 25 GB 传输空间
常见问题
Q:Intel Mac 能用 iOS 26 模拟器吗?
不能。 iOS 26.3 Runtime 仅支持 arm64。Intel Mac 最高可用 iOS 18.x(需 x86_64 + arm64 通用 Runtime)。
Q:只拷贝 Xcode.app 够吗?
不够。 模拟器 Runtime 存储在以下系统目录,不在 Xcode.app 内:
/System/Library/AssetsV2/com_apple_MobileAsset_iOSSimulatorRuntime/ # iOS 26.x
/Library/Developer/CoreSimulator/Cryptex/Images/bundle/ # iOS 18.x
/Library/Developer/CoreSimulator/Volumes/ # 挂载点
~/Library/Developer/CoreSimulator/Devices/ # 设备实例
Q:拷贝完成后 Xcode 看不到 Runtime?
依次尝试:
sudo xcrun simctl runtime scan-and-mount
killall Xcode
# 或重启 Mac
Q:Runtime 挂载路径在哪里?
iOS 26.3 → /Library/Developer/CoreSimulator/Volumes/iOS_23D8133/
iOS 18.6 → /Library/Developer/CoreSimulator/Volumes/iOS_22G86/
iOS 18.4 → /Library/Developer/CoreSimulator/Volumes/iOS_22E238/
.simruntime 文件位于各 Volume 内:
<Volumes/iOS_xxxxx>/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS xx.x.simruntime
Q:如何清理不用的 Runtime 释放空间?
# 查看占用
xcrun simctl runtime list
# 删除指定 Runtime(会先关闭相关模拟器)
sudo xcrun simctl runtime delete <UUID>
# 删除 30 天未使用的 Runtime
sudo xcrun simctl runtime delete --notUsedSinceDays 30 --dry-run # 先预览
sudo xcrun simctl runtime delete --notUsedSinceDays 30 # 确认删除
快速操作流程
场景 A:新 Mac,有网络
# 安装 Xcode 26.x 后
xcodebuild -downloadPlatform iOS
xcrun simctl list devices available
场景 B:离线迁移 iOS 26 到另一台 Apple Silicon Mac
# ── 源 Mac ──
xcrun simctl shutdown all
sudo cp "/System/Library/AssetsV2/com_apple_MobileAsset_iOSSimulatorRuntime/c6f07ed8ec1586ca140801a2c7c60f478e947602.asset/AssetData/Restore/094-26194-058.dmg" \
/Volumes/U盘/iOS_26.3.1.dmg
# ── 目标 Mac(已装 Xcode 26.x)──
sudo xcrun simctl runtime add /Volumes/U盘/iOS_26.3.1.dmg
xcrun simctl runtime list
xcrun simctl list runtimes
场景 C:迁移已有 App 数据的模拟器
# ── 源 Mac ──
xcrun simctl shutdown all
cp -R ~/Library/Developer/CoreSimulator/Devices/<UDID> /Volumes/U盘/sim_backup/
# ── 目标 Mac(已有 iOS 26.3 Runtime)──
cp -R /Volumes/U盘/sim_backup/<UDID> ~/Library/Developer/CoreSimulator/Devices/
killall -9 com.apple.CoreSimulator.CoreSimulatorService
xcrun simctl list devices