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

Post not yet marked as solved Up vote post of patniemeyer Down vote post of patniemeyer
33k views
  • thanks, I do this ,and fixed!

    But I'm using macOS Monterey

Add a Comment

Replies

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...

  • it's working for me

    Thanks :D

Add a Comment
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.

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.
  • This worked for me, thanks!

Add a Comment
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

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 also have this problem since upgrading iPhone to iOS15 and Xcode to V13.0. Even when I now go back and use Xcode 12.5.1 and target iOS 14.3, I still get the same problem. Very irritating - testing almost impossible. Occurs even with the simplest "Hello World" SwiftUI example app (as well as with all of my own apps which never exhibited any of this behavior before).

    Can anyone help!?

  • same here! For now I deselected Product -> Scheme -> Edit scheme -> Select Run (left column) -> untick Debug executable Not the best solution probably but waiting for Apple to fix this. It seems a bug...

Add a Comment

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

  • I'm have the same problem. I'm used XCode 13.3.1, it's very slow in debug memory moment.

Add a Comment