Debugging an Authorization Plug-in remotely via SSH

In an old document from Apple(Debugging An Authorization Plug-In With Xcode), a method was taught to debug plugins on the device remotely, but I can't find this feature in the new Xcode version. Does it exist In the new Xcodes?

https://developer.apple.com/library/archive/technotes/tn2108/_index.html#//apple_ref/doc/uid/DTS40007965-CH1-SECCONFIGXCODE

Answered by DTS Engineer in 774259022

Does it exist In the new Xcodes?

No.

There’s currently no supported way to remotely debug a macOS program using Xcode [1]. This is an oft-requested feature and, while a lot of underlying infrastructure for this has been added in recent versions of Xcode, it’s not packaged as something we can use (r. 58890752)-:

In this specific situation I typically debug by logging into the machine over SSH and running the lldb command-line tool directly. This isn’t ideal, but it’s not as bad as it sounds because of the way I approach such problems.

Debugging authorisation plug-ins would be a hassle even if you could do it with Xcode. You still have to install the plug-in, log out, and log in, and all of that takes time. So, it’s best to avoid this sort of debugging if possible. I do that in two different ways:

  • I structure my code to avoid debugging. This means good unit testing.

  • For interactive stuff, I have a small testbed app that hosts my plug-in. That way I can debug that rather than debugging interactive stuff in situ.

That means I typically only need to fire up LLDB when I’m debugging integration problems, and the command-line LLDB is actually pretty good for that task.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] There are unsupported techniques for this but DevForums isn’t the right place to learn about those (-:

Accepted Answer

Does it exist In the new Xcodes?

No.

There’s currently no supported way to remotely debug a macOS program using Xcode [1]. This is an oft-requested feature and, while a lot of underlying infrastructure for this has been added in recent versions of Xcode, it’s not packaged as something we can use (r. 58890752)-:

In this specific situation I typically debug by logging into the machine over SSH and running the lldb command-line tool directly. This isn’t ideal, but it’s not as bad as it sounds because of the way I approach such problems.

Debugging authorisation plug-ins would be a hassle even if you could do it with Xcode. You still have to install the plug-in, log out, and log in, and all of that takes time. So, it’s best to avoid this sort of debugging if possible. I do that in two different ways:

  • I structure my code to avoid debugging. This means good unit testing.

  • For interactive stuff, I have a small testbed app that hosts my plug-in. That way I can debug that rather than debugging interactive stuff in situ.

That means I typically only need to fire up LLDB when I’m debugging integration problems, and the command-line LLDB is actually pretty good for that task.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] There are unsupported techniques for this but DevForums isn’t the right place to learn about those (-:

Debugging an Authorization Plug-in remotely via SSH
 
 
Q