Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing Mac System Proxy Settings In Command Line Tool Application

Is it possible to change proxy settings ( like what networksetup does ) in a command line tool app ? I mean I want to write a command line tool that can change network and proxy settings in mac.

If yes, Can anybody provide any source that I can go and search for starting points and learn about it ?

like image 609
Sepehrom Avatar asked Feb 25 '26 11:02

Sepehrom


1 Answers

You can simply use NSTask to run networksetup with desired arguments. In order to do that you must include AppKit framework to your application. (But please note that you need root privilege to use networksetup in order to change proxy settings)

like image 86
Sean Ed-Man Avatar answered Feb 28 '26 07:02

Sean Ed-Man



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!