SMAppService.daemon initial pkg install

What I did.

  1. Started with the example at https://developer.apple.com/documentation/servicemanagement/updating-your-app-package-installer-to-use-the-new-service-management-api

  2. Changed it to configure a system daemon instead

 let service = SMAppService.daemon(plistName: "com.xpc.example.daemon.plist")
  1. Disabled automatic register in the package postinstall script (or else pkg install fails)
  2. Built/Installed the package, it just places files in the disk
  3. Validated install files
  4. Ran the test|register commands by hand
sudo ../SMAppServiceSampleCode.app/Contents/MacOS/SMAppServiceSampleCode" register
  1. Dealt with System Settings user interaction to do this

  2. Validated that com.xpc.example.daemon is installed and ready to work

  3. sudo launchctl list | grep example

  4. sudo launchctl print system/com.xpc.example.daemon

  5. Got it to successfully do some work, YAY sudo ../SMAppServiceSampleCode.app/Contents/MacOS/SMAppServiceSampleCode" test

Expectations

My users would obviously download and install this pkg, so to make it easy for them. I would expect that I could call

SMAppService.daemon(plistName: "...")
 .register()

during the package postinstall installation step and the system daemon would be configured.

Observations

After getting all my teeth pulled why can't I just do that?

Why so many hurdles for the dev and the end user, asking them to code sign this and that, notarize this and that, click here and there, accepting this and that?

I understand the job of a developer but for the end user this should be relatively easy.

Questions

Do I need to start a DTS ticket to get this simple flow to work? It could be I'm missing step 42 in my endeavor :-)

SMAppService.daemon initial pkg install
 
 
Q