'Not able to run/debug any mac binary in Xcode or lldb on macOS Monterey
- Monterey 12.3.1
- MacBook M1 Pro
- Xcode 13.3.1
- user is part of
adminand_developergroups
I am not able to debug/run any binary (even simple, empty main()) from Xcode or lldb:
(lldb) run
error: process exited with status -1 (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.))
Xcode shows the same message. Console.app shows couple of messages:
1 +0.000000 sec [128a6/0103]: error: ::task_for_pid ( target_tport = 0x0203, pid = 75941, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0203, pid = 75941, &task ) => err = 0x00000005 ((os/kern) failure) (0x0000000
Same binary runs fine outside of the lldb or Xcode.
I have tried with disabled SIP, run as sudo, adding/forcing get-task-allow entitlements, reinstall Xcode but problems remains.
I am looking for some hints how to "debug" this problem before I reinstall macOS (since this is an IT hardware and reinstalling is a bit complicated process).
Thanks in advance!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
