Search code examples
iphoneiphone-sdk-3.0mac-address

How can I programmatically get the MAC address of an iPhone 3G S?


This question has an answer, but it only works on the old iPhone and iPod touch.

On the iPhone 3G S, it gives me "00:00:00:00:00:70", which is incorrect.


Solution

  • Stupid me: I had Wi-Fi turned off. Actually, even if Wi-Fi is turned on, but is not currently connected to a network, it doesn't show up!

    The Wi-Fi interface appears to be called en0, while pdp_ip0 (the interface for the MAC I mentioned in the question) is the cellular network.