Get list of networked devices via CLI I want to get all the entries I would normally get via Finder, but using command line. So from this:



I want to retrieve at least "celeste-7" and "Time Capsule" (just the label is fine) directly in a bash script or applescript.

Commands like ippfind and dns-sd -B _ssh._tcp . don't show all the devices I see in the Finder, not even half.

Any ideas?
You are using the correct dns-sd to discover local services. The problem is you need to search for all the potential items.

Screen sharing, AFP file sharing, SMB file sharing, etc...

Worse, if you have Back to My Mac and iCloud connected devices, not all of them are local, but they are still discoverable from the command line:


Is it possible to terminal login remotely (outside local network) to my mac at home via SSH + VPN?
Does Apple Remote Desktop connect to computers over the internet?
Screen Share connects to wrong device


If you wanted to pick apart all the ports / protocols you could use the Network Utility to port scan each device you see in you finder sidebar and look for the common ports that are listening.

Apple’s big list of ports and names is here:


https://support.apple.com/en-us/HT202944


I think you’ll get good coverage if you start with remote control, file sharing (VNC/AFP/SMB) though.