Search code examples
iosxcodedebugginglldb

Debugger: Xcode has killed the LLDB RPC server to allow the debugger to detach from your process. You may need to manually terminate your process


Message from debugger: Xcode has killed the LLDB RPC server to allow the debugger to detach from your process. You may need to manually terminate your process.

I keep running into errors when trying to run Xcode projects. The first one involved a code signing issue and after fixing that I am now running into this debugging issue. I never had issues like this before but once I upgraded by iPhone to 15.6.1 is when these issues started to occur. This happens to every application I attempt to run.

Could someone please explain what this message means and if they have any solutions to how I can solve this?


Solution

  • This happens when the process of attaching the debugger to the new process goes too slowly and Xcode thinks lldb is stuck. One common cause of that for remote debugging is if there's no "host side" copy of the system libraries that are loaded into your binary on the phone. iOS applications are really complex these days, with lots of shared libraries and lots and lots of symbols. lldb has to read them all since you might want to put a breakpoint on any one of them.

    The debugging protocol lldb uses has the advantage of ubiquity but it wasn't designed for high speed data transfer. When lldb has to read all that symbol information from the process being debugged, that goes pretty slowly.

    Xcode gets around this by copying the system libraries from your device to a cache on the host Mac, putting them in a place lldb knows to look for them. It has to do that every time it sees a device with a new OS. It sounds like that process has failed.

    The cache is stored on the Mac you are debugging from in:

    ~/Library/Developer/Xcode/iOS Device Support/<OS Version>
    

    There might be no directory for your 15.6.1, or there may be one, but it doesn't actually have all the files. You can often fix this by deleting the <OS Version> directory in the Device Support, and then unplugging and re-plugging in your device. The next time Xcode runs you should see some message about "preparing device for debugging" - which is it copying these files over. If that still doesn't work, it's best to file a bug with the Apple BugReporter so we can look into it more deeply.