How do I do this using a programmatically set static IP address for the host iPhone.
Set static IP address
There’s no supported way to programmatically set a static IP address. Why do you want to this?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
so I‘d like to do it programmatically.
AFAIK nothing has changed in this space. There is certainly no way, on iOS, to modify the TCP/IP configuration of a wired Ethernet interfaces.
This device picks a random IP un the 169.254.x.x network.
By “device” do you mean the iOS device? Or your accessory?
If your accessory is choosing a self-assigned IPv4 address [1] then you shouldn’t need to configure a static IP address on the iOS device. By default it will choose a similar self-assigned IPv4 address and that’ll allow you to communicate.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
[1] Per RFC 3927 Dynamic Configuration of IPv4 Link-Local Addresses.