Lost connection to the debugger

After updating Xcode to version 12.5 and using simulator 14.5, I'm getting disconnected all the time from the debugger. Please can someone help me?

I also get this: Domain: IDEDebugSessionErrorDomain Code: 4

Accepted Reply

I talked to someone at Apple, and they gave me a temporary solution. As others already have said, larger apps with lots of dependencies are taking too long to launch. This is causing the debugger to abort and time out. To fix that, follow the steps:

  1. Create a file called .lldbinit on your home directory (~)
  2. Add this line to the file: settings set plugin.process.gdb-remote.packet-timeout 300
  3. Restart Xcode and try again

It's working fine after that.

  • Thank you!!! Worked for me.

  • Thank you so much! It worked! I have been suffering and waiting to find a solution. THANKS!!!

  • This was bugging me for like 3 months now. Thanx a lot for this solution. Really. It's Working flawlessly. (I am on Xcode 12.3)

Replies

anyone?

I am also having this issue. But I'm running an earlier version of Xcode (for reasons of unsupported frameworks).

Details

Lost connection to the debugger on “iPhone 12 Pro Max”.

Domain: IDEDebugSessionErrorDomain

Code: 4

System Information macOS

Version 11.4 (Build 20F71) Xcode 12.2 (17535) (Build 12B45b)

  • You can try running sudo DevToolsSecurity -enable I'm testing here. This command enables the user to be part of the developer group, so it can debug.

Add a Comment

anyone solve this issue? if so, pls share your solution. Thank you

It's a bug with dyld. https://developer.apple.com/forums/thread/679098

Apple, pay attention on this. We can't debug in Xcode.

Same here, does anyone know how to fix it?

I talked to someone at Apple, and they gave me a temporary solution. As others already have said, larger apps with lots of dependencies are taking too long to launch. This is causing the debugger to abort and time out. To fix that, follow the steps:

  1. Create a file called .lldbinit on your home directory (~)
  2. Add this line to the file: settings set plugin.process.gdb-remote.packet-timeout 300
  3. Restart Xcode and try again

It's working fine after that.

  • Thank you!!! Worked for me.

  • Thank you so much! It worked! I have been suffering and waiting to find a solution. THANKS!!!

  • This was bugging me for like 3 months now. Thanx a lot for this solution. Really. It's Working flawlessly. (I am on Xcode 12.3)

Still not working for me. i am using ios software version 14.6 on iphone 7 and bigsur 11.4 and xcode version 12.4 (12D4e)

after i updated the 14.6 support, it started this issue. It will not detach the debugger now after i add the .lldbinit but still does not show the variables, it i just showing the loading progress.

Hardware Overview:

 Model Name: MacBook Pro  Model Identifier: MacBookPro16,2  Processor Name: Quad-Core Intel Core i7  Processor Speed: 2.3 GHz  Number of Processors: 1  Total Number of Cores: 4  L2 Cache (per Core): 512 KB  L3 Cache: 8 MB  Hyper-Threading Technology: Enabled  Memory: 16 GB  

  • You should use Xcode 12.5 with iOS 14.6

  • will try this and let you know.

  • Finally it is working after upgrading my xcode to 12.5.

Still not working for me. iOS 14.6 xCode 12.5 (12E262)

Symptoms: xCode "lost connection to the debugger" in few seconds after I activate the airplane mode on my iphone. The solution with the .lldbinit file doesn't work for me.

  • Setup: iPhoneSE 15.2, Xcode 13.1 (13A1030d)

    Anyone who knows any workaround about this?

  • I am having the same problem and the accepted solution doesn't work for me too.

  • I have this same exact issue on my iPhone. I tried restarting my mac and the iPhone to no avail. However, I don't get this behavior on a different device. So this seems to be device-specific.

Add a Comment

Suggestion by dbug18 worked for me. If the issue is not resolved for you try deleting derived data, format the simulator, do pod cache clean, restart the machine, and repeat the steps above.

Upgrading to 12.5.1 worked for me.

I submitted the patch in llvm https://reviews.llvm.org/D102833.

Use 'plugin.process.gdb-remote.packet-timeout' for now until llvm is released.

  • The main reason for the problem is that dyld has modified the _dyld_process_info_create function implementation, which has increased the function's time consumption significantly and caused a huge delay in attaching the program. All I can do is add a cache for the use of this interface in the debugserver.

Add a Comment

i too faced the problem, it was due to installing big sur on pre installed xcode on the machine it was resolved by removing xcode and installing the latest xcode

This is still an issue when I am trying to debug using XCode 12.4 (12D4e) and iPad Air 4th gen (2020) with iOS 14.7.1. I have tried the suggestion with .lldbinit file above, but does not work.

Apple, are you listening?

Connection lost if I connect iPhone iOS 16.5 via USB an use xcode 14.3.1 (14E300c)

Post not yet marked as solved Up vote reply of Down vote reply of

Just replace the type-C cable. Then it works!

  • Thank you for your suggestion - it worked straight away. Using Xcode Version 15.2 (15C500b) with iPhone 12 mini v 16.7.2 - this issue has caused problems for a good while now.

    Strange how the old cable works on iOS 17.3.1 and iPadOS 17.3.1 devices.

    Replaced cable with a new Apple cable - I also notice an increase in app download speed from Xcode.

Add a Comment