External Links

Use Eclipse and ADB with wireless adb on Linux

posted Jan 14, 2012, 1:50 PM by Carlos Silva

Hi, here's the thing, I have a Nexus One, a Samsung Galaxy Tab 7" and a Motorola Xoom. And as you may know, I happend to be an Android programmer and I like to test my applications on every fisical device I have. My problem is that I have a laptop that I use for developing and that laptop only has 3 USB ports (sucks ). Anyway, I decided I wanted to have all the 3 devices connected all the time so I can decide when I test an application from Eclipse, I'm able to choose which one to install the application to. So here's what I got:

1st: Install Wireless ADB from the Market on every device you want to test your applications.

2nd: When you activate Wireless ADB on a device, it will toast the address you should connect to. Take a note of it.

What this code does is create a function on your environment that checks if the device is connect wirelessly and if not connects to it. After that, it just executes the command you asked for (eg. logcat). It also creates an alias to that function so that the command is similar to the normal one. So, to use adb with my Xoom I just have to type "adbxoom logcat" pe.

You can duplicate this piece of code as many times as you want for all the devices you have, in my case, I have 3 of these: adbxoom, adbn1 and adbtab .

To this code take effect on the current shell, just type ". ~/.bashrc" or ". ~/.bash_profile" depending on the file you edited.

5th: If you have more then one device, Eclipse will always ask to each one you want to deploy the application, but if you have only one and still want to choose between a fisical device and an AVD, the task gets a little complicated. Heres how you do it:

On the Run button on Eclipse (the green play button), press the dropdown button and choose "Run Configurations". Next select the "Target" tab on the right and choose the "Manual" Deployment Target selection mode. You're Done

Now you don't have to mess with cables, connecting a bunch of them to your PC and being switching them all the time because you don't have a USB Hub.