如何在使用Xcode 14时在iOS 17设备上运行

huangapple go评论120阅读模式
英文:

How to run on iOS 17 Device using Xcode 14

问题

Xcode 15 beta不包含iOS 17的设备支持文件。是否有其他方法可以在Xcode 14上运行iOS 17设备?

英文:

Xcode 15 beta does not come with Device support files for iOS 17. Any other way we would run iOS 17 devices on Xcode 14

答案1

得分: 49

在终端运行:

defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled

然后重新启动 Xcode 14,iOS 17 设备将显示在 Xcode 中,如下图所示,您可以像往常一样运行和调试应用程序。 (您可能需要转到“设备和模拟器”以配对/信任设备)

我已经安装了 Xcode 15 beta,与 Xcode 14 并行安装,我不确定是否需要。

英文:

In the terminal run:

defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled

Then restart Xcode 14 the iOS 17 device will show up in Xcode like below and you can run and debug the app as usual. (You may need to go to Devices and Simulators to pair/trust the device)

I have Xcode 15 beta installed alongside Xcode 14, I'm not sure if that's required or not.

如何在使用Xcode 14时在iOS 17设备上运行

答案2

得分: 6

这是有点复杂的,但我找到的唯一一种在iOS17设备上测试使用Xcode 14构建的应用程序并仍然能够进行调试的方法如下:

  1. 使用Xcode 14归档应用程序 - 选择“任何iOS设备”作为运行目标。
  2. 在“组织器”中,选择归档,然后选择“在查找器中显示”。
  3. 使用“显示包内容”展开归档,然后打开“产品 -> 应用程序”以查看应用程序 - 以后会需要这个。
  4. 关闭Xcode 14,打开Xcode 15。
  5. 在Xcode 15中,在“设备和模拟器”中,选择您的iOS17设备。
  6. 在“已安装的应用程序”底部点击“+”按钮,并将来自步骤#3的应用程序文件拖放到其中。您应该看到应用程序的构建编号在“已安装的应用程序”列表中更新。
  7. 您现在可以手动在iOS17设备上运行从Xcode 14构建的应用程序 - 不要使用Xcode 15中的“Cmd+R”,否则您将替换刚刚安装的应用程序。
  8. 仍然在Xcode 15中,使用“调试 -> 附加到进程”附加到应用程序的进程 - 断点似乎不起作用,但您可以打印到日志中。

当然,您还可以通过TestFlight交付应用程序而不是执行步骤1-6,然后只需使用Xcode 15附加到应用程序的进程和您的iOS17设备。

我的原始答案在Apple开发者论坛上:
https://developer.apple.com/forums/thread/730947?answerId=756651022#756651022

英文:

It's a bit convoluted, but the only way I've found to test apps built using Xcode 14, on an iOS17 device - whilst still being able to debug is as follows:

  1. Archive the app using Xcode 14 - choose the "Any iOS Device" run destination.
  2. In Organizer, select the archive, and "Show in finder".
  3. Expand the archive using "Show Package Contents", then open "Products -> Applications" to see the app - you'll need this later.
  4. Close Xcode 14, and open Xcode 15.
  5. In Xcode 15, in "Devices and Simulators", select your iOS17 device.
  6. Hit the "+" button at the bottom of "Installed Apps", and drop the application file from step #3. You should see the build number of the app update in the "Installed Apps" list.
  7. You can now run the app built from Xcode 14 manually on the iOS17 device - not using "Cmd+R" from Xcode 15 or you'll replace the app you've just installed.
  8. Still in Xcode 15, attach to the app's process using "Debug -> Attach to Process" - breakpoints don't seem to work, but you can print to the log.

You can also of course deliver the app via TestFlight instead of steps 1-6, and then just attach to the app's process using Xcode 15, and your iOS17 device.

My original answer on the Apple Dev Forum here:
https://developer.apple.com/forums/thread/730947?answerId=756651022#756651022

答案3

得分: 3

截至目前,iOS 17 暂时没有设备支持文件可用。

> 从 iOS 17+ 开始,我们正在使用新的设备堆栈(CoreDevice)与设备通信。使用这个新的设备堆栈,每个平台只有一个 DDI(与每个操作系统发布版相对)。这个相同的设备堆栈将在您系统上的所有 Xcode 版本之间共享,并且安装更新版本的 Xcode 将会更新 CoreDevice 及其 DDIs(就像您熟悉的 CoreSimulator 一样)。

> 这实际上意味着现在您有一种支持的方式来更新系统上的设备堆栈以支持更新的目标操作系统设备。通过 CoreDevice,您应该能够使用 Xcode 15 调试运行未来版本 iOS 的设备。这可能需要首先安装更新版本的 Xcode 以安装新的 CoreDevice 和 DDIs,所以请记住这一点。

> 当然,这也意味着旧的不受支持的路径暂时无法使用,但好消息是未来您将有一种支持的方法可以立即使用,无需修改您的 Xcode.app。

查看这个 Apple 论坛,

iOS17 设备支持 Apple 回复

他们建议只使用 Xcode 15 beta。

> 好消息是,今后我们不需要更新设备支持文件,如果安装最新版本的 XCode,它将默认工作 如何在使用Xcode 14时在iOS 17设备上运行

英文:

As of now, there are no device support files available for iOS 17.

> 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.

Check out this Apple forum,

iOS17 Device support Apple reply

They are recommended to use Xcode 15 beta only.

> Good news is, hereafter we don't need to update device support files in the future it will work by default if we install the latest version of XCode 如何在使用Xcode 14时在iOS 17设备上运行

答案4

得分: -1

苹果开发者论坛正式表示,即使在过去可能有效,但您尝试的操作目前不受支持。但如果您想尝试非官方或黑客风格的方法,您可以考虑以下方法:

  1. 启动一个Corellium虚拟iPhone(默认情况下它已越狱)用于iOS 17。
  2. 设置USBFlux,以将设备远程传递为本地Xcode 14连接的虚拟USB设备。
  3. 调试并附加到指定的进程,与之交互。

请参阅https://support.corellium.com/features/connect/usbflux

如果您不能升级到Xcode 15,这是否是正确的假设?如果是这种情况,间接的方法是改进您的应用程序中的日志记录,然后查看在iOS 17上安装它是否显示任何问题,然后可以从Console应用程序中查看的日志进行后续调试。

另一种方法是,如果您的应用程序是模块化的,只有其中的一个方面失败,您可以创建一个新的应用程序,只包含与关注的相关模块,然后在本地使用Xcode 15将其工作正常,用它来调试您的问题。

英文:

The Apple Developer forums officially say what you're trying to do is not supported even if it might have worked in the past. But if you want to explore non-official or hack-style approaches, you could consider the following:

  1. Boot a Corellium Virtual iPhone (by default it is jailbroken) for iOS 17
  2. Set up USBFlux to remotely pass the device as a virtually connected local USB device to your local Xcode 14.
  3. Debug attach to the named process and interact with it.

See https://support.corellium.com/features/connect/usbflux

One presumes you cannot upgrade to Xcode 15 - is that a correct assumption? If you are in that position an indirect approach is to improve the logging within your app and then see if installing it on iOS 17 shows any issue which could be subsequently debugging from logs viewable from the Console app.

Another approach is that if your app is modular and only one aspect of it fails, you could create a new app just incorporating the relevant module of concern and then get that working with Xcode 15 locally, and use that to debug your problem.

答案5

得分: -4

One way to deploy to iOS 17 devices is to use Xcode 15.

英文:

One way to deploy to iOS 17 devices is to use Xcode 15.

huangapple
  • 本文由 发表于 2023年6月6日 16:27:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/76412754.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定