My requirement is like, I want IP and MAC address of devices which are connected to my iOS device's hotspot. How can I get a list of IP address of those devices? Does Apple allow to get hotspot related information through code.?
-
@DixitAkabari thanks for your comment but it's not giving the list of IP addresses which are connected to personal hotspot, it is working fine when using wifi network. – gaurgtm Dec 14 '17 at 10:32
-
@gaurgtm did you ever resolve this? – Nate Birkholz Feb 01 '18 at 22:30
-
Is there any open source or Swift API to achieve this? – Joe Dec 03 '19 at 15:50
-
Adding a bounty to this as I really need this feature in one of my apps, I've downloaded apps which have this capability so I know that this is possible. Hoping that someone can provide a solution to this. Cheers – Shayno May 14 '20 at 13:24
-
Hey, check this out: https://stackoverflow.com/questions/22807795/how-to-get-client-list-of-hotspot-in-ios-in-objective-c it may be the thing u are looking for. – joshii_h May 21 '20 at 13:00
1 Answers
Unfortunately I don't know a way to get the actual client list (or ARP table for that matter).
But you could implement a scanner. Have you thought of that? Isn't the beautiful solution you're most probably looking for, but might be something?
Here would be a scanner library as reference: https://github.com/mavris/MMLanScan
You could also get your devices IP address and network mask, calculate the possible IP range yourself and implement an ARP query per candidate device using sysctl
and gethostbyaddr
as described in this post
https://stackoverflow.com/a/2269903/1041122
EDIT sidenote: Did you have a really deep read of the NetworkExtension API from Apple? I don't know it well but since it allows numerous configurations that might be possible as well.

- 7,474
- 7
- 59
- 107