FORUMS
Remove All Ads from XDA

[Guide] ADB connection between two Android devices

2,219 posts
Thanks Meter: 316
 
By danger-rat, Senior Member on 14th October 2012, 02:09 AM
Post Reply Email Thread
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/d...V2lyZWxlc3MiXQ..
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
The Following 6 Users Say Thank You to danger-rat For This Useful Post: [ View ] Gift danger-rat Ad-Free
 
 
14th October 2012, 06:23 PM |#2  
beekay201's Avatar
Senior Member
Thanks Meter: 1,231
 
More
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.
The Following 3 Users Say Thank You to beekay201 For This Useful Post: [ View ] Gift beekay201 Ad-Free
14th October 2012, 06:46 PM |#3  
danger-rat's Avatar
OP Senior Member
Flag USA
Thanks Meter: 316
 
More
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...
The Following User Says Thank You to danger-rat For This Useful Post: [ View ] Gift danger-rat Ad-Free
14th October 2012, 09:52 PM |#4  
beekay201's Avatar
Senior Member
Thanks Meter: 1,231
 
More
Quote:
Originally Posted by danger-rat

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...

Agreed.

Sent from my i9250

edit: checkout this commit @aosp-master: https://android-review.googlesource.com/#/c/41846/

i'll be cherry-picking this one today
30th April 2013, 04:55 AM |#5  
elfaure's Avatar
Senior Member
Flag San Francisco Bay Area
Thanks Meter: 108
 
More
Quote:
Originally Posted by danger-rat

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.
7th May 2013, 05:54 AM |#6  
elfaure's Avatar
Senior Member
Flag San Francisco Bay Area
Thanks Meter: 108
 
More
Quote:
Originally Posted by elfaure

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.
6th March 2014, 11:28 AM |#7  
Bhargav97's Avatar
Senior Member
Gandhinagar - INDIA
Thanks Meter: 563
 
Donate to Me
More
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?
16th May 2014, 05:02 AM |#8  
Senior Member
Flag Vancouver
Thanks Meter: 231
 
Donate to Me
More
Prompt 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
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes