Search code examples
adbiotraspberry-pi3android-things

Connect AndroidThings to adb via ethernet cable


Quick question. It is possible to get adb via ethernet cable connected to my laptop instead of connecting to router?


Solution

  • This is possible, though it's a bit more work. Here are a couple of options:

    1. Run a DHCP service on your laptop to assign the board an IP address.
    2. Connect to the board over serial and assign a static IP address.

    If the ethernet port in your laptop doesn't autocross, you may need to connect the devices using a crossover cable instead of a patch cable.

    DHCP Service

    Static IP

    1. Use the serial debug console instructions to connect a serial cable and access the shell.
    2. Connect the Ethernet cable between the board and your computer.
    3. Run the following command as root (replace x.x.x.x with a real IP address): ip addr add x.x.x.x dev eth0
    4. Verify that the IP address was set properly with ifconfig
    5. Run adb connect x.x.x.x or adb connect Android.local

    The static IP address will only stick as long as the Ethernet link is active. If the device reboots or ethernet is unplugged, you'll have to run this procedure again.