How do I connect w/ adb
to the Raspberry Pi 3 running Android Things?
Download a terminal emulator from Google Play (there are lots that are free). Make sure that your Android device is connected to your Wi-Fi and get the Wi-Fi IP address. Open the terminal program and type:
su setprop service.adb.tcp.port 5555 stop adbd start adbd Now go to your computer (assuming that you are using Windows) and create a shortcut on the desktop for "cmd.exe" (without the quotations).
Right click on the cmd shortcut and choose "Run as Administrator"
Change to your android-sdk-windows\tools folder
Type:
adb connect ***wifi.ip.address***:5555
(example: adb connect 192.168.0.105:5555)
adb should now say that you are connected.
Note: if you are too fast to give the connect command it may fail. So try at least two times five seconds apart before you say this doesn't work.
Follow the steps :
it worked with my version of Android [5.0]
Install ConnectBot Install ConnectBot on your tablet which is an Android terminal emulator available from Google Play. It allows to SSH into the Raspberry Pi.
Configure the Raspberry Pi You can perform those changes when connected via any method to your Raspberry Pi. Add the following lines into your network configuration:
vi /etc/network/interfaces
allow-hotplug usb0 iface usb0 inet dhcp
When you would have already connected all devices, and you do not want to reboot, just restart the network:
/etc/init.d/networking restart
Connect your devices
Connect your Android Tablet to a Raspberry Pi USB port via a micro-USB cable. Power your Raspberry Pi with a standard USB power supply. You can use any DC USB power supply. **Enable Android USB tethering Enable USB tethering on your Android tablet.
*Settings → Connections → Tethering and Wi-Fi hotspot → USB tethering** Now the Raspberry automatically gets an IP address via its USB0 port. The Android tablet behaves like a NAT router. This should work both when your tablet is connected to Wi-Fi or to a mobile 3G/4G network.*
Initiate an SSH login to the Raspberry Pi
Start the ConnectBot App on Android
Login to the Raspberry Pi via SSH
The only problem is that you have to know the IP address of the Raspberry Pi; it seems to be (always?) 192.168.42.159...
Network setup This part has to be done by your self using your SSH and local network config.
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:
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