Use and purpose of Android.local
Asked Answered
N

3

5

Recently I was looking at the Android-Things SDK, and I have installed it on my Raspberry Pi device.

To connect Raspberry Pi with ADB I have used:

adb connect <ip address>:5555

But then I have found something like this:

adb connect Android.local

Reference

By searching lot of things on Google I have not found anything related to Android.local. Is there any documentation about this or not?

Naturalize answered 6/1, 2017 at 6:40 Comment(3)
I found this hidden in the Android Things documentation - check step 7 developer.android.com/things/hardware/raspberrypi.htmlColigny
@Coligny oh yes, thanks for link, but does there anything else where we can use this Android.local or any other purpose of this ?Naturalize
It seems like its only the PI that broadcasts this address (not sure about other android thing devices), have tried to use it with other android devices and it doesn't connect with it.Coligny
R
7

Also on operating systems like Windows that doesn't support mDNS out of the box you can install the Bonjour Service developed by Apple. The Bonjour Service provides a new command line tool for mDNS requests called dns-sd. Execute the following command to search for your Android Things device:

dns-sd -Q Android.local

The tool doesn't terminate and will continuously print out all devices with the passed FQDN. I connected my Raspberry Pi over Ethernet and WiFi. Because of that I get two addresses:

Timestamp     A/R Flags if Name                             T   C Rdata
22:18:47.771  Add     2 13 Android.local.                   1   1 192.168.x.123
22:18:51.247  Add     2 13 Android.local.                   1   1 192.168.x.124

Also changes will be tracked like a link down of my WiFi connection:

22:19:52.940  Rmv     0 13 Android.local.                   1   1 192.168.x.124
Recrement answered 6/1, 2017 at 21:25 Comment(1)
On Linux, the equivalent of dns-sd -Q is avahi-resolve -n, but in typical Linux fashion it just returns the result and exits, rather than continuously polling.Illume
A
2

Raspberry Pi broadcasts the hostname Android.local over Multicast DNS. So, if your PC supports MDNS, you can config like this link.

And this is document for mDNS

Anorthite answered 6/1, 2017 at 7:33 Comment(0)
Z
0

Though above answer deliver the proper knowledge, I would like to add some cherry on the cake.

  • The Raspberry PI Automatically broadcasts Android.local and should resolve to the IP address assigned to your Pi on port 5555. Running the following:

adb connect Android.local

  • For years the ".local" domain seemed to be a sane choice for local networks running on private (RFC 1918) IP addresses. Today we learned that ".local" is nowadays used for zeroconf network services.

  • As per Wikipedia ...Networking device hostnames ending with .local are often employed in private networks. ->Using the .local label for the full DNS name for the internal domain is a more secure configuration because the .local label is not registered for use on the Internet. This separates your internal domain from your public Internet domain name.

-Hope it helps Thanks in advance.!~!

Zacek answered 24/4, 2018 at 8:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.