osx - How to execute a shell command with root permission from swift -
osx - How to execute a shell command with root permission from swift -
i new on swift , trying create simple application executes root shell command when press round button.
i have found next link online, explains how execute shell command user permission on swift, doesn't tell how root privileges: http://practicalswift.com/2014/06/25/how-to-execute-shell-commands-from-swift/
how can it?
quick-and-dirty:
nsapplescript(source: "do shell script \"sudo whatever\" administrator " + "privileges")!.executeandreturnerror(nil)
alternatively privileged helper tools expect much more complicated.
osx shell swift root nstask
Comments
Post a Comment