Android ADB over Bluetooth

Today I had no WiFi. And no USB cable. So I figured out a way to use ADB over bluetooth, because no one can stop me from developing an App. It is a rather simple hack, which should work on any rooted phone (or tablet).

All you need is a terminal emulator for android, and a bluetooth capable linux computer, of course.

First off, you have to have bluetooth enabled on both devices. Then you need to start the personal area network daemon on your phone (or tablet). Open your android terminal emulator, become root

and then

Now your device is ready to receive tcp/ip calls over bluetooth. If you look inside ifconfig, you can see that there is a new network device called bnep0. But that device still needs an IP so

Or whatever IP suits you. Now you can start the adb daemon on your phone.

Now you can scan for your android device on you linux computer

there should now be a list of all nearby bluetooth devices. Just copy the appropriate mac address and connect:

now you should have a new networking device listed in ifconfig, which is also called bnep0. To be able to connect to your android device you also have to give an IP.

If everything worked out nicely, you should be able to connect your adb (or whatever tcp/ip service you want)

Happy coding!

8 thoughts on “Android ADB over Bluetooth

  1. Greetings I located your blog by mistake when i searched Google for this subject, I need to say your blog is definitely valuable I also seriously like the theme, it is good!

  2. I was searching for adb over bluetooth for quite a while! Thanks so much for sharing this howto. However, I have some trouble setting it up on my HTC Rhyme (Android 2.3) – when I su and then “pand –listen –role GN” – I get “Failed to open control socket: Protocol not supported” – any ideas to solve this?

    • You could try “insmod bnep”, to see if you have the kernel module on board and to load it. If not, then you have to find a distribution that does, for example CyanogenMod, and copy it from there. Could work.

  3. Your post is exactly what I was looking for. Congratulations. But… it doesn’t work for me: when I issue “pand” or “hcitools”, I get an error message “pand: not found”, “hcitools: not found”. I would be very happy to know where you got these utilities running on your phone. Telling this in you post would make it more complete.

  4. All in all i did try your tutorial however in the end I wasn’t able to connect.

    Some useful information that I came across however I would like to share.

    First and formost on most devices and most roms you can’t utilize the bnep alias unless you first establish the pan connection. Secondly the question of how to set the port doesn’t present itself.
    Whenever we try to set the port along with the
    ifconfig bnep0 192… command we run into “invalid argument”

    I’d like to give a shoutout to anyone at all that has actually been able to establish a connection with adb over bluetooth on linux or even windows. If anyone out there has been successful at this please chime in here.

    I also think its worth noting that you can set adb to persistantly use tcp (network) based connections over usb by using “setprop persist.adb.tcp.port 5555” or whatever port number you wish and you can turn it off with “setprop persist.adb.tcp.port -1”

    Unfotunately after days of trying and on multiple different devices, roms and using different pc’s i haven’t been able to get a stable connection. Unless i’m missing something detrimental.

    Any thoughts at this point would be incredibly helpful to this articles author.

    Thanks!
    David

  5. update:

    I have been able to get a successful connection in ubuntu 11 and CM7.

    However a windows solution is still greatly needed. I wouldn’t mind running something like cygwin or ?msygit? or something like that and allowing bash to take control of the adapter temporarily. However running VMWare or something similar to that would probably be overkill.

    Thanks again for this very helpful article and I hope to hear your thoughts on these issues soon!

    • Hello David, thanks for your interest! Would you be so kind and explain what you have done to get it running on your device so I can update the post? Or was it just the ROM, that lacked some of those tools? I guess if the tools are absent, you could simply use the ones that are provided by CyanogenMod, given that they must be binary compatible with ARM anyway.

      I don’t think we will see something like that on windows, since most bluetooth capabilities are limited or hidden in a way, at least last time I checked.

Leave a Reply

Your email address will not be published. Required fields are marked *