Unable to launch + Attach to Mac Widget (Sonoma + Xcode 15)

Attempting to launch a widget in Debug mode on Sonoma from Xcode 15 is failing with the following message:

attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)

Looking in console I see this message:

macOSTaskPolicy: (com.apple.debugserver) may not get the task control port of (MacGalleryWidget) (pid: 1851): (MacGalleryWidget) is hardened, (MacGalleryWidget) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger(com.apple.debugserver) is not a declared read-only debugger

What Xcode settings should I be looking at to rectify this? I suspect I may have something that's out of whack.

Unable to launch + Attach to Mac Widget (Sonoma + Xcode 15)
 
 
Q