Xcode 11 hangs while attaching debugger to ios process

When I attempt to launch an app from Xcode 11 (gm seed 2) to my attached iPhone running iOS 13 the I see the app launch with a white screen but then the iOS process hangs for about *60 seconds* before the app finishes launching. If I un-check "debug executable" on the target then this behavior does not happen. If I launch the app on the phone directly (without xcode) it launches normally. If I launch the app on the phone and attempt to attach the debugger from xcode I get the same (one minute) hang.


This only happens on one of my machines even though both are using the same setup (only diff is that one is a laptop and one is a desktop). So I am assuming something is wrong or corrupted with the "debug support" that was installed on first connect to the new xcode... But I can find no reference to how to re-init that. I have tried the "unpair phone" option in devices in xcode but it does nothing. I don't see anything in settings related to developer profiles or debug symbols.


Anything I can do to reset the phone with respect to debgging support / symbols installed by xcode? Any other thoughts?


thanks,

Pat

UPDATE: This is happening on that machine even when targeting a new phone and with a fresh install of XCode 11! It must be something hosed in the environment... What outside of xcode could be involved with this? Bear in mind that it's not broken - just takes *60 seconds* to attach the debugger.

I'm facing the same issue now. Did you resolve the issue patniemeyer?


This happens:

  • only on my iMac and iPhone 11pro combination, it doesn’t happen if I build on another macbook or if I try it with another phone
  • for any app, even the newly create sample app
  • only if “Debug executable” is turned on in edit scheme, and if I just run the app from the homescreen it’s fine

What I tried already:

  • deleting derived data ofc 😀
  • restarting the phone
  • restarting iMac
  • reinstalling Xcode
  • clearing trusted computers from the phone

Hi! I was suffering from the same problem.

My development environment is as follows.

Xcode 11.3.1, iPhone 7 iOS 13.3.1, MacBook Pro (2016) macOS Catalina version 10.15.3

I was able to solve it in the following way.

1. Quit Xcode.

2. Open the Mac desktop application Terminal.app.

3. Execute command "rm -rf ~/Library/Developer/Xcode".

4. Open Xcode.

5. Select the Xcode menu "Product - Scheme - Edit Scheme".

6. Check the "debug executable" in "Run - Info"

7. Then I was able to debug.

thanks.

I encountered the same problem today.

Environment:

Xcode 11.4.1, Mac mini 2018, macOS Catalina 10.15.3,

tested with two iPhone 6(both are iOS 12.4.6), they have this problem too(but not in every launch),

also tested with an iPhone 8+, which doesn't have this problem at all


I deleted folders inside ~/Library/Developer/Xcode/iOS DeviceSupport/ (folder's name started with 12.4.6), then run Xcode and launch an app again, problem solved.


What a weird bug...

I first encountered this annoying bug with Xcode 12 beta 1 on my Macbook, and it still persists as of beta 4. Makes development experience on/for Apple platforms even worse.
Same issue here on Xcode 12 beta 4 running iOS 14 beta 4 on a device.
Well, here it is, "release day," and...envelope, please?

IT'S STILL HAPPENING!

The 60 seconds thing tells me that a TCP/IP or Bluetooth timeout is happening.

I should mention that Charles Proxy is not showing anything happening on the Mac, so the timeout is happening on the device.
EDIT: Deleted contents of ~/Library/Developer/Xcode/iOS DeviceSupport, as @tszpan suggested, and after a while it's working now!

Just updated to Xcode 12 GM and this is happening.

14
I've experienced this since installing Xcode 12. It makes debugging on a device really painful. Interestingly it does not seem to be a problem with an iPhone 6s running iOS 14 but is a GIGANTIC problem with my iPad Pro and iPhone 11 running iOS 14.

I have found a marginally useful workaround however. If I change the Run scheme to "Wait for the executable to be launched" instead of "Automatic" the problem goes from being absolutely insufferable to only somewhat annoying. It still takes a bit of time to go from the launch screen to the main screen but nowhere near as long as when in "Automatic" mode.

So change the project's run scheme and hit "Run", the code will compile and install. Launch the executable manually, then breathe calmly for a minute or so and everything should be working. Well, it does for me. Good luck.

Hope this helps some of you - Apple really needs to fix this. You just can't debug everything on the simulators!
Remove all breakpoints and try again.
Still a problem. Xcode Version 12.0 (12A7209)

Per advice here, I deleted the iOS 14 folder inside ~/Library/Developer/Xcode/iOS DeviceSupport.
(My iPhone is now on 14.0.1, so I left the 13.7 folder alone.)

It took a long time for Xcode to "copy cache files" from the iPhone but once that finally got done, normal build-and-run behavior is back. Nice and snappy.
Hi all! .. I was the same problem. After reading all entries a tried to remove only the device support version with the problem:

rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport/14.1\ \(18A8395\)/

After this:
  • I closed the Xcode 12.1

  • I disconnected the iPhone XR with iOS 14.1

  • I started the Xcode

  • I opened the project

  • I connected the iPhone

Finally a new device support was make:
~/Library/Developer/Xcode/iOS\ DeviceSupport/14.1\ \(18A8395\)\ arm64e/

Now the problem is solved!!

thx to everyone!!
As of today this affects me all of a sudden. Running on my iPad Pro 2015 no problem, but when debugging on my iPhone XR the app hangs about a minute on the launch screen and then starts. Then all is fine, but on the next build and run, the same thing.

I deleted everything in the library/developer folder, but that did not help, nor any of the other solutions posted here. Would be grateful for a solution ...

Big Sur, Xcode 12.2, devices on 14.2

thanks, I do this ,and fixed!

But I'm using macOS Monterey

I have the exact same problem, none of the solutions posted here worked for me.

Big Sur 11.6, Xcode 13, iOS 15.0.1

I updated to Xcode 13.2 beta and I have this issue as well (macOS 11.5). Tried everything without success!

I have this issue randomly with Xcode 13.4.1 under macOS 12.4 on Apple Silicon, debugging a Mac app, not Rosetta. Breaking the app shows the main thread is stuck in a function called uniquing_table_stack_retain, underneath of an NSWindow function. The rest of the app is non-responsive. The only thing I've found to fix it is to completely terminate the debug session and hope the next one doesn't get stuck.

I should mention that my hangups mostly happen when debugging with full Guard Malloc and Malloc Scribble enabled for the run, which also has a huge impact on memory usage and allocation overhead, both used memory and time to allocate.

Well I have also this problem since Xcode 13.4.1 and WatchOS 8.7. Immediately when the Debugger reaches a breakpoint the lldb-rpc server crashes. Your workaround is not working, so I Hope that Xcode 14 will fix this problem

I'm on XCode 15.2, and it's also hanging while attaching the debugger.

It seems to happen sometimes (not all the time) when I switch between a wireless connection and a wired connection between XCode and my device. Probably when I lose my patience and plug in the cable while XCode is building/installing to the device.

The above steps alone did not work for me. I found that I also needed to shut down and restart my iPhone. So, here's what I do when this happens:

  • Close Xcode
  • Delete ˜/Library/Developer/Xcode/Derived Data
  • Delete ˜/Library/Developer/Xcode/iOS Device Support (note that I'm not deleting entire Xcode directory as that also deletes your archives)
  • Shut down Mac
  • Shut down iPhone
  • Restart iPhone
  • Restart Mac

Some of these steps are probably unnecessary, but as this doesn't happen too frequently for me, I just follow this to be on the "safe" side.

are you supposed to delete all folders in ~/Library/Developer/Xcode/iOS DeviceSupport/?

I have 4 iphone folder names.

Xcode 11 hangs while attaching debugger to ios process
 
 
Q