Android Things: ADB over USB on Raspberry Pi
Asked Answered
B

3

1

I'm playing with Raspberry Pi 3 Model B and Android Things. I was able to configure everything (connect Pi over Ethernet, then reconnect over Wi-Fi with Android.local) and debug the app. However it's not convenient sometimes to debug over Wi-Fi when I travel and I have to change Wi-Fi networks or don't have Wi-Fi connection at all.

I know there is serial debug console, but it seems to be for getting logs and shell commands, not for debugging.

Any chance to have direct debugging over USB cable just like any other Android device like smartphone/tablet?

Boling answered 29/5, 2017 at 11:42 Comment(0)
E
5

The NXP i.MX7D development board has the same pins as the Raspberry Pi for development, however it uses USB-C for power and ADB.

Highly recommend it over the Raspberry Pi

https://developer.android.com/things/hardware/imx7d.html


(source: android.com)

Exchequer answered 29/5, 2017 at 17:27 Comment(1)
wired ADB is not supported on the Raspberry Pi, so while yes thats the only limitation - it cannot be guaranteed more issues may not arise in the future because its not supportedExchequer
R
6

How to debug Android Things device over USB?

Briefly: you can't do it with Raspberry Pi.

Why not?

Let's look at the pin specification of Raspberry Pi micro USB (J1):

enter image description here

where

  • 1: power
  • 2: D- (data out), not connected
  • 3: D+ (data in), not connected
  • 4: NC, not connected
  • 5: GND (ground)

So summing up the above said: no data pin connection - no adb. You can only power your RPi over micro USB.

Any chance to have direct debugging over USB cable just like any other Android device like smartphone/tablet?

Use another board. In fact, any board that has USB OTG and is supported by Android Things would allow debugging over USB, just as a "regular" smartphone/tablet.

And ironically, by the time of this writing, all the supported hardware platforms would fit except for Raspberry Pi :)

Redound answered 29/5, 2017 at 19:29 Comment(1)
I have the Edison & NXP both support usb adb :-)Exchequer
E
5

The NXP i.MX7D development board has the same pins as the Raspberry Pi for development, however it uses USB-C for power and ADB.

Highly recommend it over the Raspberry Pi

https://developer.android.com/things/hardware/imx7d.html


(source: android.com)

Exchequer answered 29/5, 2017 at 17:27 Comment(1)
wired ADB is not supported on the Raspberry Pi, so while yes thats the only limitation - it cannot be guaranteed more issues may not arise in the future because its not supportedExchequer
D
0

Another option is to setup Wi-Fi access point on your laptop and allow the Pi to connect to it. I have not tested it but it should work.

Desensitize answered 30/5, 2018 at 2:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.