Xcode 15/16: Copy (cmd+C) doesn’t work reliably when paused at a breakpoint

I’ve been running into an annoying issue for a while now and wondering if anyone else can confirm or suggest a fix.

When Xcode hits a breakpoint (i.e., the app is paused), I often need to copy some text from the source code using cmd+C — for example, to paste into the debugger and inspect a variable or object. However, most of the time, the copy operation fails and nothing ends up on the clipboard. I have to repeat the copy action multiple times before it works.

This doesn’t happen 100% of the time, but it’s frequent — maybe around 7 out of 10 attempts fail. I’ve been noticing this behavior since around Xcode 15.

Has anyone else experienced this? Is there a known workaround or fix?

Are you sure Xcode isn't just locked up? When you hit a breakpoint, or sometimes even step to the next line, it can take a long time before the debug inspector pane is useable. I assume that any operation you do in Xcode during this time is likely to fail. You just have to wait for it. Once the debug inspector pane has its data and is useable, then I expect everything should work. But this can take anywhere from 3 to 30+ seconds, even on a fast machine.

I assume that if I’m able to select text in the code editor, then Xcode itself isn’t locked up. It responds normally to all the usual debugging interactions — for example, it shows pop-up variable previews when I hover the mouse over them, scrolling works fine, and everything else behaves as expected.

Xcode 15/16: Copy (cmd+C) doesn’t work reliably when paused at a breakpoint
 
 
Q