Editing system defaults from Swift

234 views Asked by At

I'm working on an app, and need to alter com.apple.loginwindow. Specifically I need to perform the equivalent of this command:

sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Howdy""

I've attempted to run this through a Process(), but I get an "Operation is not Permitted" error.

Would anyone know a solution to this? Or a better way to write to these defaults? I'm fairly new to Swift so any help is appreciated!

I'm using Swift4, with Xcode 9.1

0

There are 0 answers