XCode15 debugger is working really slow with iOS 17.0.2

Xcode 15 and iOS 17.0.2 causing debugging issues when running from Xcode using a cable. When I updated to the new Xcode 15 and device to iOS version to 17.0.2, it is taking a long delay of 1 to 3 minutes to launch the app in the real device. It is also really slow after launching. Every step over or into take almost a minute. I can see the below warning in console "warning: libobjc.A.dylib is being read from process memory. This indicates that LLDB could not find the on-disk shared cache for this device. This will likely reduce debugging performance." I tried with the fix of executing the following command to clear the Device support files rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport. But even after I am facing the same issue.

Please do the needful to fix this issue.

Same here, please fix this ASAP, it steels half of my working day!

Same issue with iOS 17.0.3 It's impossible to debug on a real device

32 gig of memory on an M1 Max MBP and it's awful debugging on Xcode 15, do Apple look at these forums or is it better to leave feedback at https://developer.apple.com/bug-reporting/

I think I know what problem is, for me it seems that instead of using the usb cable to debug the app on the device, XCode is using WIFI even though I'm selecting a device that is connected over USB

I turned off WIFI and just used ethernet to connect to the network. So Xcode was forced stopped using WIFI to talk to the device, but instead it used the USB cable

Then all the debugging went a lot faster

It seems that Apple have been making changes around Window -> Devices And Simulators. On Xcode 15.0.0 the 'Show run destination' could not be set to Never, but now it works ok.

I'm just guessing but it seems that Xcode is trying to connect over WIFI to all the devices and send all the debugging over WIFI even when usb is connected.

Turning off WIFI on the MBP and using ethernet worked round the issue and debugging to the device went a lot faster....hope this helps!

Hello! We are currently working on a large project consisting of 3.97 million lines of code, with 1.3 million lines in Swift, 1.5 million lines in Objective-C, and several files in other languages. Our app's debug build size is over 700MB, while the main binary is 350MB. However, after updating to Xcode 15 (15.0.1, 15.1b1, 15.1b2), we have noticed a significant increase in build time, launch time, and debugger attaching time. It now takes approximately 1 minute from the installation completion to the app's start launching. Furthermore, the initial retrieval of variables on the first breakpoint also takes 1 minute or even longer.

Could you please advise us on how to resolve this problem? Thank you

After spending several hours profiling lldb, I have identified the reason behind the high CPU usage and slow app launch and breakpoints. It turns out that a custom xcconfig file was disabling dSYM for the Debug build. However, once I restored the dSYM in the Derived Data Xcode, both lldb and our app started up quickly again.

It seems to work after adding dSYM File.

Thanks for the help! it is quite painful to have a single step take 7 seconds and more to get a variable's value...

What do you mean by "restore the dSYM in the Derived Data"? In "Build Options" for my project, I changed "debug information format" set to "DWARF with dSYM file" (it was just "DWARF" before). It then ran a clean on the project, rebuilt it all...

and I'm still getting 7 second single steps...

Am I doing the right fix?

Also... I've noted that when a breakpoint is hit (or single step), the stack trace view (typically on the left side of screeen) shows the threads as 1 line, but it is essentially hung. After a few seconds, the threads are expanded to show their call stacks. When that expansion happens, the debugger becomes usable.

I think this means that xcode is spending several seconds figuring out the the call stacks for all the processes (about 17 of them for me) and that is slowing things down. FYI...

I think there is a bug in Xcode. Normally lldb can get symbols from binary with DWARF. dSYM is not required.

Build with dsym file works for me, but this makes build time really long

The same issue. Still repro in Xcode 15.2.

Our team found working solution:

  1. Run in Terminal
nano ~/.lldbinit
  1. Type and save:
settings set target.experimental.swift-enable-cxx-interop false
  1. Restart lldb-rpc-server process

The only workaround I've found that works 100% of the time is this:

  1. Disconnect iPhone from USB cable if already connected
  2. Put iPhone in airplane mode
  3. Connect to USB cable and wait for Xcode to finish connecting to it
  4. Take iPhone out of airplane mode

Apparently Xcode doesn't switch back to wireless debugging after establishing a wired connection so you should be fine for the duration of the session. But ofc if you disconnect the device for any reason (or relaunch Xcode?) then you'll need to repeat this.

Build with dsym file works for me. Same issue reproduced in Xcode 15.3

After deleting all files in ~/Library/DeveloperXcode/DerivedData/ everything works as expected for me.

XCode15 debugger is working really slow with iOS 17.0.2
 
 
Q