I’m trying to make a simple macOS App which runs a shell script with administrator privileges when a specific button is pressed. To run the shell script in term
The correct terminal command should be as (if you use specific shell inside script then sh
should be replaced correspondingly, say bash
)
$ osascript -e 'do shell script "sh /Users/andreas/checkertool.sh" with administrator privileges'
so your arguments should be as follow:
process.arguments = ["-e", "do shell script \"sh /Users/andreas/checkertool.sh\" with administrator privileges"]
P.S. assuming you do this w/o sandbox, because I have doubts it would allow this.