0

I have a couple of Apple devices in my network (both computers and mobile devices). I was wondering if it is possible, to get the model identifier like Macmini9,1 if I have the IP address and/or the Mac address.

I am using the NetServiceBrowser and NetService classes to find the devices. If the device has the AirPlay service, I can get the model identifier.

However, not all of my devices seem to implement/publish this service (it requires devices running Monterey or later and only devices 2018+ are supported). Is there a more general approach?

I saw that some apps can also get additional information from any device in the network (like the vendor name). How is it possible to get this information in a Swift based app?

macOS seems to know this information. In the Finder a specific icon is shown, so I guess the model identifier must be published somehow:

Devcies in Finder

Update:

It seems like this information can be gathered using a Bonjour service called _device-info._tcp.

I have the following code:

let service = NetService(domain: "", type: "_device-info._tcp", name: "Mac-Mini.local.")
service.delegate = self
service.startMonitoring()

I tried a specific domain ("local.") and various names (Mac-Mini, Mac-Mini.local, Mac-Mini.fritz.box) but I did not get any TXT message.

I updated the Info.plist and added the key.

Does this still work on Ventura? (well it must be, since Finder still shows the icon).

inexcitus
  • 2,471
  • 2
  • 26
  • 41

2 Answers2

0

I solved the problem by using a NetService.

inexcitus
  • 2,471
  • 2
  • 26
  • 41
-1

I saw that some apps can also get additional information from any device in the network (like the vendor name).

One way to get that information is from a lookup service such as macaddress.io, maclookup.app, etc. Vendors can have a range of MAC addresses assigned to them, so it's possible to determine the vendor from the address.

Caleb
  • 124,013
  • 19
  • 183
  • 272