Question: how to debug xpc service?
Answer: Debug -> Attach To Process -> By Process Identifier (PID) or Name... Type in your XPC service process name. The next time launchd starts up your XPC service, Xcode will attach.