Unable to debug app on phone

After updating macOS (macbook M2 Max) to Version 15.0 Beta (24A5298h) and running Xcode version 16.0 beta 4 (16A5211f), I am no longer able to debug apps on phones due to that I can not load them to the phone (even with cable connection). I had no issues in the past with these phones. The error message in Xcode is "Previous preparation error: Developer Mode disabled; To use iPhone for development, enable Developer Mode in Settings → Privacy & Security."

But the phones are in Developer mode. Updating phones to a later iOS version does not help. Also, going back in Xcode does not help, as with macOS 15.0 Beta you need to have Xcode 16.0

Trying other phones that worked in the past does not help. Reinstalling Xcode does not help either. I see the phones in Finder, so there is a connection. Enabling/Disabling the Developer mode switch on the phone does not help either. Rebooting devices neither. Tried everything available on the internet, but no results.

Need to test on phones, as I am using AR, which doesn't to run with the simulator.

Did you try to de-register and then re-register the iPhone on Xcode ?

see reply

After updating to macOS 15.0 Beta and Xcode 16.0 beta 4, I can’t debug apps on my iPhone. Even though Developer Mode is enabled, Xcode says it’s disabled. I’ve tried updating iOS, reinstalling Xcode, changing cables, and rebooting devices, but nothing works. This could be a beta bug, so check release notes and report it. Make sure all profiles are updated and consider downgrading to stable versions if possible.

I met the same bug here and have reported it. Wondering if there is any workaround besides reverting to stable versions.

There is a known issue in Xcode (or more specifically in CoreDevice below Xcode) where we represent a failure to fetch Developer Mode status from a device as that device having Developer Mode off (133418906).

If you get an error from Xcode saying Developer Mode is off and you know for certain it is on, then you are most likely hitting this issue.

So as for why we're not able to fetch the Developer Mode status, that is an issue under active investigation right now (131662031). While it is being actively investigated, new data from the field is often helpful in determining the cause of such issues. If you are encountering this issue, please collect a sysdiagnose from both the host and device and file a feedback report with both. In your report, please indicate that this is a duplicate of 131662031 and you are providing more data to help with triage.

As for getting out of this state, the easiest way I know is to force a wired connection to the phone. To do that:

  1. Connect via cable with your Mac.
  2. Disable Wifi on your phone.
  3. Open Terminal and ensure you can connect with the phone using xcrun devicectl device info details --device <identifier> (note: you can get the identifier from xcrun devicectl list devices).
  4. Once you are connected via wire, you can turn Wifi back on.

The reason for turning Wifi off is that if you are already connected via wifi, we continue to use that wifi connection even after physically connecting via wire. We would only switch to the wired connection at some point in the future after there are no more active connections to the device (which we force by turning off wifi).

@Developer Tools Engineer

Getting this error while trying the workaround. WARNING: Unable to retrieve complete information for this device. The best available information will be returned. Error: The operation failed because Developer Mode is disabled.

@Developer Tools Engineer file it under Feedback Assistant, including indication that it is a duplicate of 131662031. Included the sysdiagnose for the MacBook, including various iPhones I have the issue with. However, the workaround did not get me out of this state.

purchased an additional MacBook, installed Xcode etc. Not the beta versions. This one just works with the same phones on the beta iOS releases. So I am able to further debug, and hoping that non beta version of Xcode (in store) and macOS in the future will make my developer macBook working again correctly. Note. It looks indeed something in CoreDevice, as finder can just connect to the phones normally.

AIUI (and this very well may be wrong, or it may be just some of the cases... we are still investigating, so grain of salt, etc...) it seems to be an issue with MobileDevice.fw, specifically when the tunnel to the device is established over the netowrk ("wifi") rather than over USB+NCM. So to workaround this, you need to force CoreDevice to establish the tunnel over the wired connection. You may also be able to workaround it by grabbing an older MobileDevice.fw, but then you might run into dependency hell... =/

Check devicectl device info details --device <Identifier> and look for "transportType: wired". If that's showing that you're using the network (wifi), then you need to force yourself back to the wired connection by doing the airplane mode dance I mentioned above.

If you still see this issue when you have transportType == wired, then please point that out in a new radar because the cases I've seen have all been related to wifi.

@Developer Tools Engineer The result of getting the details does not give a transportType back. below are the results. I could not send whole part as Reply tool complains about language!

devicectl device info details --device 00008101-000219E40E28001E Current device information: • supportedDeviceFamilies: [1] • thinningProductType: iPhone13,2 • udid: 00008101-000219E40E28001E deviceProperties: • ddiServicesAvailable: false • developerModeStatus: enabled • hasInternalOSBuild: false • osBuildUpdate: 21G93 • osVersionNumber: 17.6.1 • rootFileSystemIsWritable: false • bootedFromSnapshot: true connectionProperties: • authenticationType: manualPairing • isMobileDeviceOnly: false • lastConnectionDate: 2024-08-19 12:58:35 +0000

• pairingState: paired
• tunnelState: unavailable

• visibilityClass: default

That state (tunnelState: unavailable) means that CoreDevice doesn't see the device as available for connection at all. Is it actually pysically connected via USB? Assuming so, could you check the USB section in Systm Information to see if it is showing up there?

If it's showing up in System Information but not to CoreDevice, there are a few layers to check next, but I'll need host and device-side diagnostics to do so. Could you collect those sysdiagnose (ideally with the CoreDevice logging profiles installed, see: https://developer.apple.com/bug-reporting/profiles-and-logs/?name=CoreDevice) within a minute or two of physically connecting the cable and confirming you're in this state?

If it isn't showing up in System Information either, then I'd start by trying another USB cable and making sure the connections are secure. If everything looks good physically, I'd try investigating if the issue is with the phone or the Mac by attaching the phone to other Macs and other devices to that Mac. It could be something physically damaged (like how my son's spilled milk permanently removed the USB feature from my Mac a few months ago), a bug somewhere in USB stack that needs investigation, or some third party software preventing the device from appearing over USB (eg: VMWare allows you do redirect USB devices to the VM rather than the host Mac).

Let me know what you find out, and I'll help you with next steps. We'll figure this out!

--Jeremy

@Developer Tools Engineer

Disabled Wifi on phone. It is showing (and accessible) all the time in Finder, but double checked in USB. There it is also visible. With the same cables, it is also working with Xcode on another macBook Pro (running stable releases of macOS and Xcode). The system diagnose was already reported in ticket: FB14875513. In the meantime I also did a sysdiagnose with Coredevice profile enabled. These files I have also uploaded under the ticket. I hope you have access to those files. Note: in the past did several things, like rebooting, reinstalling, restarting usbmux etc. etc. but all did not help.

@Developer Tools Engineer, some news? I do not get feedback in 'Feedback Assistant", so, I am still stuck. In the meantime I updated Xcode to Version 16.0 (16A242) the Release candidate, but does not help either. I do not expect that a fresh installation of Xcode from the store will help then either. So starting to get a little bit disappointed, as I do not want to reinstall macOS to an older version.

Since latest releases of xcode 16.0 Release candidate and macOS 15.1 Beta (24B5035e) I have access to the external devices again. Unclear how it is fixed, as I did not get any responses in the feedback assistant.

Unable to debug app on phone
 
 
Q