Years ago my daemon was since then using SCDynamicStoreCopyConsoleUser() function and now it longer works.
Basically the daemon needs to know the user name of who is using the system. If I restart the daemon,after the login, it gets the user name.
I tried run a shell command via my daemon ("id -F") and look likes it still picks the root as user name.
So, is there a way to get the current user name using Swift? ProcessInfo.userName fails too