I'm a developer using Lazarus Pascal, so converting ObjC and Swift comes with its challenges.
I'm trying to figure how to properly use SMAppService to add my application as a login item for the App Store.
I have learned that the old method (< macOS 13) uses a helper tool, included in the app bundle, which calls the now deprecated SMLoginItemSetEnabled. Now this is already quite a pain to deal with if you're not using XCode, not to mention converting the headers being rather complicated when you're not experienced with doing this.
The "new" method (as of macOS 13) is using SMAppService.
Can anyone explain how to use this? The documentation (for me anyway) is a not very clear about that and neither are examples that can be found all over the Internet.
My main question is:
Can I now use the SMAppService functions to add/remove a login item straight in my application, or is a helper tool still required?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have an application that mounts network shares and for this I use NetFSMountURLSync. Nothing special here, just a plain application calling this. The application is not running as root, and not using launchd and/or a privileged helper or anything that elevates priviliges.
On Intel hardware, a Mac Pro trashcan and a 2016 MBP, both running Monterey (12.6), this works flawless and has been for several years now with different macOS versions (obviously).
Now I'm trying to build an Apple Silicon version on a MBP M1 Max also with Monterey 12.6.
I recompiled this as an Apple Silicon binary, however mounting failed.
Next I ran the Intel binary on Apple Silicon, but mounting fails here as well.
In both cases I get these error messages in Console (I'm not a Console expert):
<Applicationname> (loginsupport)
GetNetAuthAuthAgentPort: Calling bootstrap_look_up3() for com.apple.netauth.user.auth; uid = 501, euid = 501
<Applicationname> (loginsupport)
GetNetAuthAuthAgentPort: gNetAuthAuthAgentPort = 51463
<Applicationname> (launchservices)
LSExceptions shared instance invalidated for timeout.
Note: Running either binary (Intel/ARM) as sudo didn't make a difference either.
I'm at a point where I can just guess that for some reason the login isn't working, even though it work just fine on an Intel Mac. I've even tried calling NetFSMountURLSync with and without username/password - it didn't make a difference.
Note: I develop my application in Lazarus Pascal (latest trunk release), so I'm not sure how useful posting the code is.
Being a newbie at this and not being able to find anything useful online, I finally resorted to asking the questions here. Can anyone explain what I'm looking at?
Just pointing towards documentation would already be helpful 😊