• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Determining current IPv4 WiFi address of iOS device?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Determining current IPv4 WiFi address of iOS device?


  • Subject: Determining current IPv4 WiFi address of iOS device?
  • From: Jens Alfke <email@hidden>
  • Date: Tue, 08 Oct 2013 11:49:53 -0700

Short question: How do I get the current IPv4 address of the WiFi interface of an iOS device?

Why? I have a test app running on an iPhone, that runs an HTTP listener. Another test tool running on a desktop machine needs to send HTTP requests to this test app. The test tool needs to be given a URL, so I want to display the URL in the main screen of the test app so it can be entered into the desktop tool. (I am not interested in hearing about mDNS/Bonjour based alternatives. They’re not what I need right now. Thanks.)

What I’ve done:  I dug up some code I wrote a few years ago that calls getifaddrs to find the addresses of all interfaces. Unfortunately I don’t have enough POSIX-network-API fu to determine which of the addresses is WiFi and which is cellular. (I also have a feeling that I must be overlooking a higher-level API for this, although neither CFHost nor SystemConfiguration seem to do what I want.)

Thanks,

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Determining current IPv4 WiFi address of iOS device?
      • From: "Quinn \"The Eskimo!\"" <email@hidden>
    • Re: Determining current IPv4 WiFi address of iOS device?
      • From: Remco Poelstra <email@hidden>
  • Prev by Date: Streaming Server Automation
  • Next by Date: Re: Determining current IPv4 WiFi address of iOS device?
  • Previous by thread: Streaming Server Automation
  • Next by thread: Re: Determining current IPv4 WiFi address of iOS device?
  • Index(es):
    • Date
    • Thread