This repository includes the code for a Launch Agent that provides an XPC service. To read the article that describes the code, you can find it here:
https://rderik.com/blog/creating-a-launch-agent-that-provides-an-xpc-service-on-macos-using-swift/
If you want to see the code for a client that consumes the XPC service check this repository
- Note: You'll find the Launch Agent
Plistfile inside SupportFiles, remember to fix the path to the executable.