Xcode 15 can't connect to iPhone 11 with iOS 17
Asked Answered
T

10

10

I've been developing an iPhone app using my iPhone 11 for it. Up until the recent release of Xcode 15 and iOS 17 everything was going fine but suddenly, a few weeks after the update, my Xcode no longer can connect to the iPhone. It's stuck on "Waiting to reconnect".

enter image description here

Here's what I've tried so far:

  1. Unpair and pair again the iPhone multiple times
  2. Uninstalled and reinstalled Xcode
  3. Tried different cables to connect the iPhone to the Mac
  4. Rebooted both my mac and my phone
  5. Disabled and reenabled programmer mode on the iPhone

None of this helped. I really need my phone connected as this is a camera app as the simulators don't run the camera.

I'm running Xcode 15 on an Apple M1 with macOS Ventura 13.6.

What can I do to be able to connect my iPhone to Xcode again?

Edit: I've tried it with my iPad 5 and an iPhone 14 and I got the same result which makes me think there's something wrong with the Mac itself. The Mac has Perimeter 81 VPN and Vanta software both of which could impact the connection via Wi-Fi. Disabling the VPN doesn't seem to solve the issue though. I'm not sure I can uninstall Vanta as it's a company owned Mac. I've never been able to connect my iPhone via Wi-Fi even before updating to Xcode 15.

According to the release notes there's a known issue with VPNs but I'm not sure that's the case here.

enter image description here

Edit 2: I've confirmed that this was indeed an issue with the company mac. Any other mac works well with my iPhone and this issue does not occur. I'm leaving the question open in case some of the solutions work for similar issues caused by different things.

Takin answered 5/10, 2023 at 11:27 Comment(3)
there is a detailed explanation on this issue here developer.apple.com/forums/thread/737875 . Unfortunately no resolution so far.Jeana
Do you solve the problem? I have this problem with xcode 15.1 and ios 17.2.1.Acetylide
Do you ever find the solution to this? The only issue are with devices with iOS 17*. iOS 16 and below works. I tried factory reset the phone too. Still doesn't work. I'm pretty sure this is related to the Mac itself. Tried on another Mac and I don't experience the same issue.Calica
H
5

In my case, when I connected both Mac (Xcode 15) and iPhone (iOS 17) via different Wi-Fi network, it started working. Try a different network, and make sure you're not behind some VPN.

Hygrophilous answered 10/10, 2023 at 11:55 Comment(0)
C
4

After 4 days of debugging console and a bit of research, I've fixed this issue. I believe the issue is related to my Mac / Xcode because the same issue doesn't happen on fresh installed Mac.

The issue is Xcode and iPhone couldn't connect because (I think) Developer Disk Image are corrupted / not found. Therefore they can't make a connection. Solution: Fix corrupted / missing Developer Disk Image

So what I did:

  • Rename /Library/Developer to something else. Probably like /Library/Developers.
  • Make sure it's on the root path, not /Users/[mac_username]/Library/Developer folder as both folder have DeveloperDiskImage folder inside.
  • Restart Xcode. /Library/Developer will populate again
  • Now the phone should work

If it doesn't work:

  • Also rename /Users/[mac_username]/Library/Developer folder
  • Unpair your phone and re-pair it again
  • Try restarting everything (Mac, Xcode, iPhone) just to be sure.

This is so hard to found because I've reinstalled Xcode 5 times, but for some reason /Library/Developer are not invalidated from scratch.

Calica answered 8/1 at 13:33 Comment(2)
iOS 17 does no longer has Developer Disk images.Kinghorn
This fixed it for me, I had to rename both Developer folders and restart. Thanks!Colonic
P
2

I encountered the same error and was able to fix it after spending days on it. To show the destination mobile, you need to be connected to an open network and not be connected to any VPN client.

I could now see my iPhone connected and when I tried to run the app, I was getting an error message

"Previous preparation error: The developer disk image could not be mounted on this device.. You don’t have permission to save the file “857A0094-E1076-3219-8287-B381FFECF183B” in the folder “CoreDevice_DDI_Staging_501”."

An error occurred while accessing/creating the folder CoreDevice_DDI_Staging_501, preventing the app from running

Follow these steps to resolve this error

  • Open folder /private/var/tmp
  • Create folder named "CoreDevice_DDI_Staging_501" manually by using finder options
  • Launch Xcode (version 15+) clean build and run the project.

As a result of following the above steps, I was able to fix the error and run/debug the application with Xcode and iOS 17.0.

Poirer answered 22/1 at 9:10 Comment(2)
Seconded. For some reason being on a VPN also blocked my wired connection. As soon as I turned my VPN off the iphone showed in the devices screen.Aland
No clue why this worked but it did. As soon as I opened Xcode I noticed a disk image appear in the newly created folder which was eventually replaced with an (empty) folder with the same UUID as in the error message.Walsingham
S
2

You may need to enable "Developer Mode" on your iPhone

Settings > Privacy & Security > Developer Mode

Sorehead answered 3/4 at 6:11 Comment(0)
P
0

Did you try to reset the network settings on your iPhone? Maybe this is causing some problems as Xcode is trying to wirelessly connect to your iPhone after pairing.

Pentosan answered 6/10, 2023 at 13:16 Comment(2)
I hadn't tried that yet. I tried it and it didn't solve the issue unfortunately. However, it may have something to do with it as I've never been able to connect the iPhone via Wi-Fi before. I always had to connect the cable to the Mac to be able to deploy test apps to the phone.Zavras
hm. Strange thing...I have an iPhone 11 Pro and it's working smoothly. Even via wifi - after the first connection via cable. Maybe opening a ticket at the Apple support? Did you do that already? Maybe they are having a bug in the new xCode or iOS version.Pentosan
D
0

I fixed it by editing the permission of /private/var/tmp:

sudo chmod 777 /private/var/tmp
Dormeuse answered 24/5 at 7:14 Comment(0)
S
0

This is what worked for me to fix this issue that has been plaguing me since since I upgraded my test device to iOS 17.

Here are the steps:

  1. Quit Xcode
  2. In Finder/Terminal go to this folder: /Library/Developer/DeveloperDiskImages
  3. Delete iOS_DDI files
  4. Restart Xcode and connect your device with cable to pair it again with Xcode

In my case I didn't need these DDI iOS files, since I currently don't do any testing on pre iOS 17 devices, but if needed they'll be recreated anyway.

Sills answered 16/8 at 15:58 Comment(0)
H
0

In my case the problem was in a contention between macOS and Xcode both asking for permission at the same time. If I tap "Clear trusted computers" with Xcode open I got one "Trust this computer?" prompt and immediately after it - another one with the same question. The solution was to close Xcode, then select "Clear trusted computers" on iPad, open Finder, approve the first "Trust this computer?" alert on iPad, then run Xcode and approve the second "Trust this computer?" alert.

Henigman answered 20/8 at 4:9 Comment(0)
A
-1

I ran into this, tried almost everything here. What solved my issue, apparently, was "hard booting" my iPhone. I'm sure 99% of people here know the difference between "hard booting" and "turning the phone off an on."

But that's what seemed to fix my issue.

Andreasandree answered 20/3 at 2:37 Comment(0)
L
-4

Kindly check the update on your iPhone, if it's not updated, update it and retry after reboot.

Lightfoot answered 5/10, 2023 at 11:39 Comment(2)
The iPhone is fully updated. It's at iOS 17.0.3 which is the most recent version at the time of writing.Zavras
it's not the iOS version. it's the new architecture of connection between Xcode 15 and iOS 17 :(. Try to connect via some privet network.Jeana

© 2022 - 2024 — McMap. All rights reserved.