Programmatically modify Ethernet settings in iOS 10.x and above

From iOS 10 onwards, Apple has introduced new Ethernet settings in the device settings option. I am trying to have a wired point to point communication from iPhone to another device using Lightening to Ethernet cable. In order to communicate, I need to manually set static IP and subnet mask under Settings-> Ethernet-> Static IP in my iPhone [as my iPhone is running in iOS 10.x, I have this additional option in the settings].


Now, my question is, does iOS provides any public API to set static IP and subnet mask programatically for Ethernet settings. Other than manually setting network options, do we have any way to set this programatically. Any help is much appreciated.

Accepted Answer

Now, my question is, does iOS provides any public API to set static IP and subnet mask programatically for Ethernet settings.

No it does not.

Other than manually setting network options, do we have any way to set this programatically.

Programmatically, no. In managed environments like this you can often achieve such goals by installing a configuration profile. However, I looked through the Configuration Profile Reference and I can’t see anything that will let you set up static IP addresses, even on Wi-Fi.

The correct solution to this problem, IMO, is to have the accessory support Bonjour [1]. Then things will work out of the box, without any messing around with static IP addresses. If you control the firmware on the accessory, I recommend that you look into that. If you don’t control the firmware on the accessory then, alas, this isn’t an option.

Normally in situations like this I recommend that folks file an enhancement request for the features they need. You can still do that if you want, but I must set expectations here. What you’re looking for is a system management API and on iOS system management is done via configuration profiles, not via APIs.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

[1] That is:

Thank you for your reply. This is much appreciated.

Programmatically modify Ethernet settings in iOS 10.x and above
 
 
Q