


The good news here is that the specific sharp edge I’m aware of, calling -setClasses:forSelector:argumentIndex:ofReply:, shouldn’t be necessary in this case. NSXPCConnection has some sharp edges when you use it from Swift.Or, put another way, an experienced Objective-C programmer is likely to have similar levels of difficulty here.Īs far as I know there’s nothing that will prevent you from implementing this technique in Swift.
#Run lunch as sudo user code#
This stuff is sufficiently complex that learning enough Objective-C to get a handle on the code is a small task compared to understanding the technique as a whole. Yes, it’s written in Objective-C but that should not be a major stumbling block in my opinion. The standard sample for this is EvenBetterAuthorizationSample.

So i'd like much to have your help because i couldn't find anything elsewhere, thank very much for your interest in helping me.
#Run lunch as sudo user mac os#
The command line tool is not made by me and it's closed source, it's the "createinstallmedia" executable from apple's mac os installer apps, and i am attempting to create a tool to create a mac os bootable usb installer in a noob-friendly way using apple's official method and to pubblish it on the app store when it will be ready, and of course it will be open source and free for everyone.
#Run lunch as sudo user full#
I need that the xpc service starts in a precise moment, when the uses clicks a specific button and then the app should pass the location of the command line tool, and the arguments to run it to the xpc service, and the wait until the xpc service ends it's job of running the executable, which can take also several minutes, after it's finished it will give back to the app some information, which are the full output ot the command lind tool and then it's exit code, becuase i need that data to determinate if the has done correctly his job and in case of error, which error it is, and to determinate that i use a combination of output analisys and kown exit codes.Īnd also i preffer that the code is swift 3 compatible because i am stiil using xcode 8, and it should run also on yosemite which is one of mine development targets, because much potetial users for my app are still running older versions of macOS. The only things i have found are the autherization samples from apple which are in objective-c only and as i mentioned, i do not understand objective-c. Hi developers, i need some help to let my app to work as it's supposed to do in the guidelines, i am creating a swift app which is a GUI for a command line tool but this command line tool does require to be run with sudo or by the root user, so to run it am temporarely using a not safe system which is just using a Process object to lunch a script with the sh executable to aks the user for the sudo password and then give that poassowrd to the sudo command and launch the command line tool, but i know that the proper way to that is by using an xpc service and then let the xpc service to do all the privilaged job, whithou having my app to deal with user credentials, but i need something for pure swift apps, i understand little to nothing of objective-c and i am also making this app in pure swift to be future proof, so i need you help to make that possible using pure swift.
