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

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -