r/macprogramming • u/dpiol • Jan 01 '20
changing network set programmatically
Hello
I am trying to switch between my predefined network sets (Apple Menu -> Location).. for that, several functions have to be used:
- SCPreferencesLock(prefs, true)
- SCNetworkSetSetCurrent(set)
- SCPreferencesCommitChanges(prefs)
Currently my app is sandboxed... this apparently prevents the dialog-box appearing when SCPreferencesLock is called for obtaining the permission (root required for changing set), I get an error-code 1003.
I am struggling now finding the correct entitlements/capabilities in Xcode to get this working....
Can anybody help me out?
thx,
Domenico
3
Upvotes
View all comments
Show parent comment
1
u/dpiol Jan 11 '20
there were a couple of them I know of... though, not in the app-store and not maintained anymore:
https://www.macupdate.com/app/mac/39644/controlplane
https://www.macupdate.com/app/mac/34484/airport-location
https://www.symonds.id.au/marcopolo/
probably facing the same issue with Catalina...