Nitesh
Nitesh

Reputation: 2034

How to run on iOS 17 Device using Xcode 14

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

Upvotes: 58

Views: 76801

Answers (9)

Daniel McMath
Daniel McMath

Reputation: 33

It appears that there's an officially-sanctioned workaround via XCode Cloud.

According to Apple Developer you can run builds on XCode Cloud with XCode 13.4.1 installed locally. As far as I can see, it appears that XCode Cloud allows you to build for the latest ios -- configure the build locally, perform the build with Apple cloud resources. The free tier (free, with your Apple Developer subscription) only gives you 25 free build hours per month, but even if you need 100hrs/mo, it's still cheaper than buying a new MBP.

Upvotes: 1

Jonathan.
Jonathan.

Reputation: 55594

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.

Important Point: It turns out Xcode 15 is required to complete initial device setup for development. After the device setup is completed on Xcode 15, iOS 17 devices can be used with Xcode 14 too.

enter image description here

Upvotes: 98

Ks 2000
Ks 2000

Reputation: 11

When update new Xcode Command Line Tools defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled maybe not work. Use disbled before run enabled again.

  1. Close Xcode
  2. Open terminal and run 2 command line

defaults write com.apple.dt.Xcode DVTEnableCoreDevice disbled

...and...

defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled

Upvotes: -1

chirag05k
chirag05k

Reputation: 61

Here is a workaround that has been working for me to support iOS 17.x in Xcode 14.x on older macOS versions.

Prerequisites:

  1. You should have Xcode 14.x installed. (This Xcode version depends on the latest Xcode version supported by your macOS. In my case, I'm using Xcode 14.3.1 with macOS Ventura 13.1. You can download the appropriate Xcode version from Xcode Releases based on your requirements.
  2. You'll also need Xcode 15.x to run the application on an iOS 17.x device.

Follow these steps:

  1. Start by cleaning your derived data.
  2. Quit Xcode.
  3. Open Terminal.
  4. Locate your Xcode application in the Applications folder in Finder.
  5. Drag your Xcode 15.x app from Finder into the Terminal. After dragging, add /Contents/MacOS/Xcode to the path. The full command should look something like this: /Applications/Xcode-15.0.1.app/Contents/MacOS/Xcode.

enter image description here

  1. Press Enter to run the command. If you encounter any errors in the Terminal, repeat step 5.

enter image description here (Reference for the error)

  1. Follow the Xcode agreement and iOS 17.0 installation steps. You will notice that when you open this version of Xcode (Xcode 14.x), the Terminal will also open. Don't close the Terminal because it will close Xcode as well

enter image description here

  1. Now, open your Xcode 14.x, select your iOS device, and run your project. It should work.

enter image description here

This solution has been tested and confirmed to work in the following environments:

  1. macOS Ventura 13.1 (22C65)
  2. Xcode 14.3.1 (I'm using this Xcode version for all my projects)
  3. Xcode 15.0.1 (Used to install iOS 17.0 on my machine)

For more detailed information, you can also refer to my Medium article on Supporting iOS 17 in Xcode 14.x on Older macOS Versions.

I hope this helps!

Upvotes: 1

Abdullah
Abdullah

Reputation: 1616

When it comes to deploying your app on iOS 17 (or macOS 14, watchOS 10, tvOS 17, DriverKit 23, or visionOS 1) devices, there’s one officially endorsed method: utilizing Xcode 15.

iOS 17 requires Xcode 15 for deployment

For those who prefer to stick with an older Xcode version (i.e. Xcode 14.3.1 or an earlier iteration), don’t fret. You can still make it work by enabling CoreDevice with a simple commands in terminal:

defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled

Once you’ve executed this command, a quick restart of Xcode will have everything operating smoothly. If, however, you still encounter deployment errors on your device, the solution lies in installing Xcode 15. This installation will automatically fetch the necessary files, conveniently shared on your system.

To know the basic concepts behind it, please checkout the link.

Upvotes: 7

Myke Savage
Myke Savage

Reputation: 302

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

Upvotes: -7

AJR
AJR

Reputation: 131

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 :)

Upvotes: 5

Faisal Memon
Faisal Memon

Reputation: 3454

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.

Upvotes: 0

siburb
siburb

Reputation: 5017

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

Upvotes: 8

Related Questions