Some of the plugins I made are written in Objective-C not in Python, and I was able to attach a debugger to Glyphs.app via Xcode so that I could happily set breakpoints to the lines I wrote. After replacing my MacBook with a newer model and migrating to Catalina, it doesn’t work as it used to be – Glyphs.app just won’t launch from Xcode. I observed that the following logs were emitted in Console.app:
default 11:48:21.579314+0900 kernel macOSTaskPolicy: (com.apple.debugserver) may not get the taskport of (Glyphs) (pid: 22962): (Glyphs) is hardened, (Glyphs) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger error 11:48:21.579372+0900 debugserver error: MachTask::TaskPortForProcessID task_for_pid failed: ::task_for_pid ( target_tport = 0x0103, pid = 22962, &task ) => err = 0x00000005 ((os/kern) failure) error 11:48:21.593960+0900 debugserver error: 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 ab
Resolving Common Notarization Issues
As described in the documentation,
com.apple.security.get-task-allow needs to be added to the entitlements to have the debugger enabled, but I know that’s not possible because the app gets rejected by the Notary Service. The people in the music industry seems to be facing the same issue, and they circumvent it by re-signing the host application (e.g. Ableton Live) on the plugin developers’ side:
I applied the codesign to Glyphs.app as shown in the post above, but this time Glyphs won’t launch by itself. I’m afraid that Glyphs is terminating itself due to such modification, but I couldn’t figure out what makes it fail to launch exactly. The app icon pops up for a slight moment in the dock, and then it dissapears. No apparent logs can be seen in Console.app.
So, here is my question: is there any established way to enable debugging a native Glyphs plugin? How can I attach a debugger process to Glyphs on Catalina?