Starting March 27, 2025, we recommend using android-latest-release instead of aosp-main to build and contribute to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
In virtualized systems, the device can have multiple VMs with each running its own ADB daemon.
In this case, the host VM can export an RNDIS Ethernet gadget, which can be used for the
TCP/IP-based communications over the USB physical link. The development machine can then use
ADB over TCP/IP to access multiple VMs on the device. The ADB daemon on the host side can
announce the ADB presence on the guest VMs over mDNS by publishing ADB services.
In addition, the development machine can browse these services with ADB tool, which
supports mDNS device discovery (ADB version
31.0.2 or
later) to get the IP address and the port number on which adb daemon is listening and then
connect to the guest VMs.
The following commands can be used on the development machine to browse and connect to
the ADB services.
adb mdns services
List of discovered mdns services
driver_vm _adb._tcp 192.168.1.49:4444
device_vm _adb._tcp 192.168.1.49:3333
To connect to the device, run:
adb connect driver_vm._adb._tcp
To list the connected devices, run:
adb devices
List of devices attached
driver_vm._adb._tcp device
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-29 UTC.
[null,null,["Last updated 2025-08-29 UTC."],[],[],null,["# Tools\n\nIn virtualized systems, the device can have multiple VMs with each running its own ADB daemon.\nIn this case, the host VM can export an RNDIS Ethernet gadget, which can be used for the\nTCP/IP-based communications over the USB physical link. The development machine can then use\nADB over TCP/IP to access multiple VMs on the device. The ADB daemon on the host side can\nannounce the ADB presence on the guest VMs over mDNS by publishing ADB services.\nIn addition, the development machine can browse these services with ADB tool, which\nsupports mDNS device discovery (ADB version\n[31.0.2 or\nlater](https://developer.android.com/studio/releases/platform-tools#3102_april_2021)) to get the IP address and the port number on which adb daemon is listening and then\nconnect to the guest VMs.\n\nThe following commands can be used on the development machine to browse and connect to\nthe ADB services.\n\n 1. To enable mDNS discovery, run: Because ADB 31.0.2 disables mDNS discovery, you must enable mDNS discovery and then restart the ADB server. \n\n ```gdscript\n export ADB_MDNS_OPENSCREEN=1\n adb kill-server\n adb start-server\n ```\n2. To discover ADB services, run: \n\n ```scdoc\n adb mdns services\n\n List of discovered mdns services\n driver_vm\t_adb._tcp\t192.168.1.49:4444\n device_vm\t_adb._tcp\t192.168.1.49:3333\n ```\n3. To connect to the device, run: \n\n ```scdoc\n adb connect driver_vm._adb._tcp\n ```\n4. To list the connected devices, run: \n\n ```scdoc\n adb devices\n\n List of devices attached\n driver_vm._adb._tcp device\n ```"]]