怎么样让Xcode14.3跑iOS17 beta的设备

背景

iOS17beta也发布了很长时间了,为了工程的稳定性,需要提前测试工程在高版本系统的是否会出现问题。其中一项就是需要在低版本Xcode中去本地跑高版本iOS设备,来定位高版本出现的问题。

问题

以往低版本Xcode要跑高版本iOS设备,只需要将/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport中对应的iOS版本添加进该目录就行,但是但是更新了xcode15之后发现,最新Xcode的DeviceSupport目录下并没有对应的ios17镜像文件。

Xcode15 beta的DeviceSupport目录:

官方的解释是:

With iOS 17+, we are using a new device stack (CoreDevice) to communicate with devices. With this new device stack, there is one DDI per platform (as opposed to per OS release). This same device stack will be shared across all versions of Xcode on your system, and installing a newer version of Xcode will update CoreDevice and its DDIs (just like how CoreSimulator is updated if you are familiar with that).

This effectively means that you now have a supported way of updating the device stack on your system to support newer target OS devices. With CoreDevice, you should be able to debug devices running future versions of iOS using Xcode 15. This may require first installing a newer Xcode in order to install newer CoreDevice and DDIs, so keep that in mind.

Of course, this also means there is a temporary hiccup in which the old unsupported path doesn't work, but the good news is that future-you will have a supported way of doing this which works out-of-the-box, no need to modify your Xcode.app.

也就是xcode15之后将会以CoreDevice的方式去对iOS设备进行兼容。 所有的Xcode设备共享一份CoreDevice和DDIs,这样在xcode15和之后版本中,只要装了最新版Xcode,所有版本的Xcode都能调试CoreDevice中兼容的iOS设备,也就是低版本Xcode也能直接兼容高版本ios设备,而无需去更改xcode中的目录。

解决问题

经测试,xcode14其实也兼容了CoreDevice的方案,只是默认是关闭的。

  1. 安装最新版macOS beta

  2. 下载xcode15 beta并安装(为了获取最新的CoreDevice)

  3. 执行命令(这一步的作用大概就是开启xcode14 的CoreDevice支持,使得xcode14能使用最新的CoreDevice。)

    shell 复制代码
    defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled

跑起来

操作系统是最新版beta,那xcode14就不能再用了 使用方式,应用程序->xcode14->显示包内容->contents->MacOS->Xcode 进程运行起来,选择需要执行的工程就OK了。 选择ios7的设备时,会有个CoreDevice的标识:

这样就能跑起来啦~

参考文档: developer.apple.com/forums/thre... stackoverflow.com/questions/7...

相关推荐
GEEKVIP1 小时前
手机使用技巧:8 个 Android 锁屏移除工具 [解锁 Android]
android·macos·ios·智能手机·电脑·手机·iphone
GEEKVIP1 小时前
如何在 Windows 10 上恢复未保存/删除的 Word 文档
macos·ios·智能手机·电脑·word·笔记本电脑·iphone
奇客软件2 小时前
iPhone使用技巧:如何恢复变砖的 iPhone 或 iPad
数码相机·macos·ios·电脑·笔记本电脑·iphone·ipad
奇客软件1 天前
如何从相机的记忆棒(存储卡)中恢复丢失照片
深度学习·数码相机·ios·智能手机·电脑·笔记本电脑·iphone
GEEKVIP1 天前
如何修复变砖的手机并恢复丢失的数据
macos·ios·智能手机·word·手机·笔记本电脑·iphone
一丝晨光1 天前
继承、Lambda、Objective-C和Swift
开发语言·macos·ios·objective-c·swift·继承·lambda
GEEKVIP2 天前
iPhone/iPad技巧:如何解锁锁定的 iPhone 或 iPad
windows·macos·ios·智能手机·笔记本电脑·iphone·ipad
KWMax2 天前
RxSwift系列(二)操作符
ios·swift·rxswift
Mamong2 天前
Swift并发笔记
开发语言·ios·swift
GEEKVIP2 天前
手机使用指南:如何在没有备份的情况下从 Android 设备恢复已删除的联系人
android·macos·ios·智能手机·手机·笔记本电脑·iphone