0

A specific func in my Swift application need root privileges. I was wondering if there is a way to gain root access at start of this func to run the following code with this privileges. Until now I only found a way to gain root access and then run a separate executable which I don't need and which wouldn't work for me.

Thanks for any hint!

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Mike Nathas
  • 1,247
  • 2
  • 11
  • 29
  • Do you need actual `root` privilege or just [administrator permission](http://stackoverflow.com/questions/6841937/authorizationexecutewithprivileges-is-deprecated/15248621)? – kennytm Mar 19 '17 at 18:22
  • I need root privilege for direct hardware access – Mike Nathas Mar 19 '17 at 18:23
  • 1
    For security reasons *run a separate executable* (process) is the recommended way. – vadian Mar 19 '17 at 18:32

0 Answers0