connect to Raspberry Pi 3 using adb

proppy picture proppy · Dec 13, 2016 · Viewed 8.7k times · Source

How do I connect w/ adb to the Raspberry Pi 3 running Android Things?

Answer

proppy picture proppy · Dec 13, 2016

Android Things for Raspberry Pi only support connecting to adb using adb-over-ip with the following command: adb connect `<raspberry-pi-ip-address>`

You have multiple options to find your IP address depending on your Pi setup:

  • If your Pi is connected to Ethernet and a screen: it should show you its IP address on the Android Things launcher screen.
  • If you have a headless Pi connected to Ethernet: you can directly ping Android.local if you have mDNS/Bonjour support, or see https://learn.pimoroni.com/tutorial/raspberry-pi/finding-your-raspberry-pi for info on how to find your Pi IP address using third-party tools.
  • If you don't have any screen or Ethernet connection, you can connect a USB to TTL serial cable on the UART0 connector (see pinout and type the following command to connect to a WiFi network and get the Pi IP address:

    am startservice -n com.google.wifisetup/.WifiSetupService \
        -a WifiSetupService.Connect \
        -e ssid '<NETWORK_SSID>' -e passphrase '<NETWORK PASSPHRASE>'
    ifconfig