手动下载iOS模拟器安装

官方文档

安装和管理模拟器提供通过 Xcode 安装和命令行安装方式,如果下载速度太慢或者总是安装失败请参考下面:

通过命令行安装watchOS/iOS 模拟器

我们可以直接在苹果开发者网站下载对应的模拟器, 然后执行如下

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

xcodebuild -runFirstLaunch

// 路径自行修改下
xcrun simctl runtime add "~/Downloads/watchOS_9.1_Simulator_Runtime.dmg" 

simctl 会校验 dmg 文件, 并将模拟器放到合适的位置, 执行完成之后

Operation not permitted 错误

如果提示:

(1) Operation not permitted
Accessing '/Users/XXXX/Desktop/iOS_17_Simulator_Runtime.dmg' requires Security & Privacy approval.

原因是没有打开终端对完全磁盘的访问权限. 在设置中找到隐私与安全 -> 完全磁盘访问权限 -> 找到终端并打开即可.

将终端权限打开即可。

How to Download iOS Simulator (Xcode) in Command Line and Install it

通过获取模拟器下载地址,使用其他多线程下载软件来手动下载,能更快下载速度。

Steps
  1. Start Xcode in command line by running this in commandline /Applications/Xcode.app/Contents/MacOS/Xcode
  2. Start downloading of the simulator
  3. Cancel it. YES CANCEL IT!
  4. You will get a message like this:
    2015-11-23 17:10:01.906 Xcode[30803:2505495] DVTDownloadable: Download Cancelled. Downloadable: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.iPhoneSimulatorSDK8_3-8.3.1.1428621365.dmg.
  5. Quit Xcode
  6. Use your favorite download tool with the link in that message in step 3
  • This is what I use: (5 concurrent connection) aria2c -x 5 link_to_the_file
  1. Have Fun!
Wait! How can I install this?

By moving the file to ~/Library/Caches/com.apple.dt.Xcode/Downloads 或者/Users/xxxx/Library/Caches/com.apple.dt.Xcode/Downloads

  • You can use Finder by open ~/Library/Caches/com.apple.dt.Xcode/Downloads
  • Or just mv file ~/Library/Caches/com.apple.dt.Xcode/Downloads

And open the Downloads tab in Xcode’s Preferences,

  • the progress bar of the item you just download should be 80% filled
  • you should be able to click that download button to install the file
  • 或者重启 Xcode 选择对应的模拟器安装,无需下载瞬间安装。
Why did I need it?

I am in China right now and when downloading in Xcode(no concurrent downloading), the download speed sucks!
I would like to use aria2 to speed up the downloading process of the simulator(s).

How slow was the connect using Xcode and how fast was it when using aria2?
  • Xcode: 150KB -> 300KB
  • aria2: 2.7MB (consistenly), which is the maximum downloading speed of my cable
Why aria2?
  • Concurrent connections
  • Resuming unfinished downloads
References
  • https://forums.developer.apple.com/message/51550#52580 where I found out ~/Library/Caches/com.apple.dt.Xcode/Downloads
  • 各iOS 模拟器下载地址懒得通过命令行获取地址的同学可以直接使用下载。
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值