Hi all,
I have a rather large iOS app that I enabled to run as a MacOS Catalyst App. I can run the app, but when I set the checkmark "debug executable" in the scheme, running the app fails with the following error message:
"Message from debugger: Process attach denied, possibly because System Integrity Protection is enabled and process does not allow attaching."
I'm using XCode 11.4.1.
In the Console log, you can see the following messages:
2020-05-10 10:56:19.787046 +0200 | com.apple.dt.lldb | error | debugserver | error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 28030, &task ) => err = 0x00000005 ((os/kern) failure) |
2020-05-10 10:56:19.787133 +0200 | com.apple.dt.lldb | default | debugserver | 10 +0.010309 sec [6d7f/0307]: error: ::task_for_pid ( target_tport = 0x0103, pid = 28030, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0103, pid = 28030, &task ) => err = 0x00000005 ((os/kern) failure) (0x0000000 |
2020-05-10 10:56:19.799117 +0200 | com.apple.dt.lldb | error | debugserver | error: MachTask::StartExceptionThread (): task invalid, exception thread start failed. |
2020-05-10 10:56:19.799177 +0200 | com.apple.dt.lldb | error | debugserver | error: MachProcess::AttachForDebug failed to start exception thread: unable to start the exception thread |
2020-05-10 10:56:19.799398 +0200 | com.apple.dt.lldb | error | debugserver | error: Attach failed because process does not allow attaching: "unable to start the exception thread". |
2020-05-10 10:56:19.799437 +0200 | com.apple.dt.lldb | default | debugserver | error: attach failed. |
2020-05-10 10:56:19.800153 +0200 | com.apple.dt.lldb | default | debugserver | 11 +0.013004 sec [6d7f/2903]: error: ::read ( 6, 0x70000b99bb00, 1024 ) => -1 err = Bad file descriptor (0x00000009) |
2020-05-10 10:56:19.800499 +0200 | com.apple.dt.lldb | default | debugserver | Exiting. |
If I create a fresh iOS app and enable Catalyst, everything works fine. So I guess it's something with the Build settings or similar.
Thanks,
Markus
If I create a fresh iOS app and enable Catalyst, everything works fine. So I guess it's something with the Build settings or similar.
Right. This typically means that your app is missing the get-task-allow entitlement (
get-task-allow
on iOS,
com.apple.security.get-task-allow
on macOS). I’ve seen two causes for this:
The Code Signing Inject Base Entitlements (
) build setting not being setCODE_SIGN_INJECT_BASE_ENTITLEMENTS
The Deployment Postprocessing (
) build setting being setDEPLOYMENT_POSTPROCESSING
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"