9

I known Apple stopped MAC address API since iOS 7. But I just found the app Fing can get MAC address. How could it happen?

If I use samillar way to get MAC address, is it allowed by iTunes review?

BTW: the How to get iOS device MAC address programmatically doesn't really help. I need MAC address, not [UIDevice identifierForVendor]. Fing app

Community
  • 1
  • 1
Yi Jiang
  • 3,938
  • 6
  • 30
  • 62
  • Find can only get the device's MAC address if the device is connected to a WiFi network. I suspect it implements an ARP scan on the local network and matches the known local IP address to determine the local MAC address – Paulw11 Nov 24 '14 at 06:39
  • Thanks @Paulw11 ! Is ARP scanning a big project? Because I need implement the MAC address feature in my app. However, We don't have experience about ARP on iOS device, and we are getting close to deadline. – Yi Jiang Nov 24 '14 at 06:46
  • You would have to implement some fairly low-level code - and remember it wouldn't work if the device is not connected to WiFi. There are some suggestions here - http://stackoverflow.com/questions/10395041/getting-arp-table-on-iphone-ipad and here - http://stackoverflow.com/questions/2189200/get-router-mac-without-system-call-for-arp-in-objective-c – Paulw11 Nov 24 '14 at 06:47
  • @Paulw11 If you answer this question, I will accept your answer. Thank you! – Yi Jiang Nov 24 '14 at 06:51
  • @RobertYiJiang Can you please tell me that How "Fing" shows the device name (just on right side of the device's IP Address for example "My iPhone") connected in LAN? I have got successfully MAC Addresses and IP Address but I am not able to get the connected Device name. So If you are getting it, kindly let me know how I can achieve this. – Nirmit Dagly Oct 29 '15 at 12:13
  • @NirmitDagly The Machine Name on the right-upper corner. The Machine Vender on the right-lower corner – Yi Jiang Oct 30 '15 at 02:30
  • @RobertYiJiang Thanks for your response. I want to get the machine name that is displayed on the right-upper corner. And I need to know that How can I get this machine-name and display it in my iOS Application? – Nirmit Dagly Oct 30 '15 at 04:41
  • 1
    @NirmitDagly, I recently dig the internal of Fing App. After capturing the packet of Fing using tcpdump tool. I found the machine-name in the NBNS(NetBIOS Name Service), my MBP's name is ZHANGCHONG02 e.g. . So you can send name query via NBSN. I hope that the above is helpful for you. – Viton Zhang Jan 06 '17 at 06:11

3 Answers3

3

Fing can only get the device's MAC address if the device is connected to a WiFi network. I suspect it implements an ARP scan on the local network and matches the known local IP address to determine the local MAC address.

There are some questions that address capturing ARP data here and here

Community
  • 1
  • 1
Paulw11
  • 108,386
  • 14
  • 159
  • 186
3

What Fing does is it pings each IP on the network and builds the ARP Cache and then it reads the Mac Address from the Arp Cache table.

IOSDevops
  • 111
  • 10
1

Here is my own answer after half year.

It is possible to check ARP table on iOS device to get iOS device MAC address, technically. See this: How do I query the ARP table on iPhone?

However, the App Store will reject your App by this. But, people said fetch the host, router and other device's MAC address will be fine. I haven't proved it yet.

Community
  • 1
  • 1
Yi Jiang
  • 3,938
  • 6
  • 30
  • 62
  • What do you mean reject the App by this? If you use this code for `arp -a` your app will be rejected? – BlackM Jul 06 '15 at 14:17
  • @BlackM People say the lib you will use is not native iOS lib. And it is banned as third party lib. And, to fetch local MAC address is violate iOS' principal which is do not expose user's unique device ID. It is related to information security and privacy issues. – Yi Jiang Jul 06 '15 at 23:45
  • No I am not talking about the local MAC address but for the other MAC addresses on the LAN – BlackM Jul 07 '15 at 05:43
  • Well, I think fetch other device MAC address will be OK. – Yi Jiang Jul 07 '15 at 05:46