[Guide] ADB connection between two Android devices

Search This thread

danger-rat

Senior Member
Feb 14, 2010
2,218
316
USA
Probably not breaking any ground here (since in hindsight it was blatantly obvious), but I thought I would share anyways...

I own several Android devices, and I'm always playing. well, tonight I was tweaking a few things over adb and got to wondering if I could use adb to connect from one Android device to another. Well, turns out it's pretty easy, if you're rooted...

Both devices need to be connected to the same wireless network.

Install adbWireless from the Playground (sorry, Play Store): https://play.google.com/store/apps/...251bGwsMSwyLDEsInNpaXIuZXMuYWRiV2lyZWxlc3MiXQ..
You only really need it on the receiving device, but I have it on everything anyway.

Copy the Linux adb binary into /system/xbin/ and set the permissions to 755 (rwxr_xr_x), and reboot.
You only really need to do this on the controlling device, but may as well do it on all.

Fire up adbWireless on the receiving device, grant root privileges, and note the IP address
Fire up a Terminal Emulator on the other device, and enter: adb connect <IP address from other device> (you typically don't need to add the :5555 on the end.

Job done! Pretty handy when working from a slate!

I also run dd-wrt firmware on my router, which let's me assign static IPs by MAC address, so the IP for the devices are always the same.

Regards - dr
 

beekay201

Senior Member
Nov 8, 2010
5,224
1,221
adb binary is already built in, /system/bin/adb.

besides that, all that's left is get adbd running, and that can be achieved either by an app (like you suggest) or edit init.rc to have adbd as one shot service to allow manual start (doesn't boot with the system). cyanogenmod also has adbd over wireless done like this.

also, one could use an OTG cable to connect devices directly, while i agree adb over wireless is good, adb over ssh would be best.
 

danger-rat

Senior Member
Feb 14, 2010
2,218
316
USA
Valid points.

The adb in /system/bin is a less functional version than the standard Linux binary (94kb versus 156kb); kinda similar to the chown binary, where the recursive function doesn't work...

I'll concede to the rest though...
 
  • Like
Reactions: Itbelikedat

beekay201

Senior Member
Nov 8, 2010
5,224
1,221
Last edited:

elfaure

Senior Member
Valid points.

The adb in /system/bin is a less functional version than the standard Linux binary (94kb versus 156kb); kinda similar to the chown binary, where the recursive function doesn't work...

I'll concede to the rest though...

Hi - Where can I get this more functional binary that's half the size of a standard linux binary? I've tried two, they are both around 330Kb, and they fail to run with error "non executable: magic 7F45" because they were not compiled for my ARMV71 processor. I ran chmod 755 on it and when I check the permissions it is executable (-rwxr-xr-x). Can you post a link to the one that's 156kb - I can't find it.
 

elfaure

Senior Member
Hi - Where can I get this more functional binary that's half the size of a standard linux binary? I've tried two, they are both around 330Kb, and they fail to run with error "non executable: magic 7F45" because they were not compiled for my ARMV71 processor. I ran chmod 755 on it and when I check the permissions it is executable (-rwxr-xr-x). Can you post a link to the one that's 156kb - I can't find it.

Bumb. Anyone home? Shoot me a link please.
 

Bhargav97

Senior Member
Mar 10, 2013
578
588
Gandhinagar - INDIA
Hey guys,

Now, I have a tablet (running android) and is rooted already (so, I'm ready to get any needed binary on my device). It supports OTG. When I plug in my phone (rooted) using OTG to my tablet, my phone says 'Android debugging enabled' in notifications, is also charging. When I go to TE (Terminal Emulator) of my tab and type: 'adb devices', it displays no device in the list of attached devices (obvious).

And yes, my tab has got OTG host modules in kernel because when I turn on USB mass storage on (in my phone), my tab detects it and I can use it.

Now, my question:
Can I actually do this? i.e., using adb in my tablet (for my phone) via OTG?
 

davecotefilm

Senior Member
May 11, 2014
869
243
Vancouver
davecote.com
Can we run adb from the device to detect itself?

I'm sure you can see why this would be amazing and powerful.. possibly giving root to apps on non-rooted devices with adb's run-as com.package.apk and such?

Is this possible? To have adb run on the Android device and connect to itself? If it is, can you guide me to where to learn it?

Dave :cyclops:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    Probably not breaking any ground here (since in hindsight it was blatantly obvious), but I thought I would share anyways...

    I own several Android devices, and I'm always playing. well, tonight I was tweaking a few things over adb and got to wondering if I could use adb to connect from one Android device to another. Well, turns out it's pretty easy, if you're rooted...

    Both devices need to be connected to the same wireless network.

    Install adbWireless from the Playground (sorry, Play Store): https://play.google.com/store/apps/...251bGwsMSwyLDEsInNpaXIuZXMuYWRiV2lyZWxlc3MiXQ..
    You only really need it on the receiving device, but I have it on everything anyway.

    Copy the Linux adb binary into /system/xbin/ and set the permissions to 755 (rwxr_xr_x), and reboot.
    You only really need to do this on the controlling device, but may as well do it on all.

    Fire up adbWireless on the receiving device, grant root privileges, and note the IP address
    Fire up a Terminal Emulator on the other device, and enter: adb connect <IP address from other device> (you typically don't need to add the :5555 on the end.

    Job done! Pretty handy when working from a slate!

    I also run dd-wrt firmware on my router, which let's me assign static IPs by MAC address, so the IP for the devices are always the same.

    Regards - dr
    3
    adb binary is already built in, /system/bin/adb.

    besides that, all that's left is get adbd running, and that can be achieved either by an app (like you suggest) or edit init.rc to have adbd as one shot service to allow manual start (doesn't boot with the system). cyanogenmod also has adbd over wireless done like this.

    also, one could use an OTG cable to connect devices directly, while i agree adb over wireless is good, adb over ssh would be best.
    1
    Valid points.

    The adb in /system/bin is a less functional version than the standard Linux binary (94kb versus 156kb); kinda similar to the chown binary, where the recursive function doesn't work...

    I'll concede to the rest though...