How can I programmatically get the MAC address of an iphone

后端 未结 12 2039
春和景丽
春和景丽 2020-11-22 08:06

How to programmatically get an iPhone\'s MAC address and IP address?

12条回答
  •  遇见更好的自我
    2020-11-22 08:33


    NOTE As of iOS7, you can no longer retrieve device MAC addresses. A fixed value will be returned rather than the actual MAC


    Somthing I stumbled across a while ago. Originally from here I modified it a bit and cleaned things up.

    IPAddress.h
    IPAddress.c

    And to use it

    InitAddresses();
    GetIPAddresses();
    GetHWAddresses();
    
    int i;
    NSString *deviceIP = nil;
    for (i=0; i

    Adapter names vary depending on the simulator/device as well as wifi or cell on the device.

提交回复
热议问题