xcode attach to debugger fails when attempting "Debug Selected View" from the editor menu

1

I am trying to debug Views with IBDesignables (I like using them for composed views, but without being able to debug, it's quite annoying to check for issues). There is an option on xcode's menu under editor -> Debug Selected View, but when I try to do that, the debugger fails to attach.

I am getting the following error:

Error creating LLDB target at path '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Overlays/IBDesignablesAgent-iOS'- using an empty LLDB target which can cause slow memory reads from remote devices.

and then

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

Upon checking console.app for the debug server attach, I see the following errors:

error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 33708, &task ) => err = 0x00000005 ((os/kern) failure)

1 +0.000000 sec [83b2/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 33708, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 33708, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005

macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (IBDesignablesAge) (pid: 33708): (IBDesignablesAge) is hardened, (IBDesignablesAge) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger

anyone have any ideas on what I should do to try to fix this? I just want to be able to figure out why IBDesignable agent sometimes crashes when using interface builder

ios
xcode
interface-builder
asked on Stack Overflow Mar 24, 2021 by iosDev • edited Mar 25, 2021 by iosDev

1 Answer

0

I ended up solving this by installing xcode 12.5 beta 3. I was unable to get it working on xcode 12.4

answered on Stack Overflow Apr 21, 2021 by iosDev

User contributions licensed under CC BY-SA 3.0