Skip to content Skip to sidebar Skip to footer

Connect Eclipse To Android Emulator On A Different Machine

Can't seem to find the following information although I'm pretty sure this should be possible: I'm running an Android emulator on a machine A. I'm developing on another machine B i

Solution 1:

You can tell adb to connect to a device listening on an IP address and TCP port. That device should then show up in eclipse. So the debug machine is easy.

The emulator machine may be harder. The emulator is listening for TCP connection on a local port. IIRC it has been established that there's no command line switch to make it listen on an external interface, though double check that. So you might have to modify and recompile the emulator, or use some kind of port-forwarder on the hosting machine. ssh might handle that for you though I'm sure there are other tools without the encryption overhead if that's not needed.

Solution 2:

In the meantime, I found a very nice solution to the problem. I installed android-x86 (http://www.android-x86.org) in a virtual machine. On the host, you then use the following commands to restart adb and connect to the vm:

adb kill-server
adb connect <VM-IP>:5555

Replace VM-IP with the actual IP of your virtual machine. If you're on a private network, the easiest way is to configure vm network as bridged so the VM gets its own IP address from the dhcp server. Should also work with Host-Only networks though as described here.

If all went well, you should see the android VM in the Eclipse debugger just like normal emulators.

Solution 3:

Eclipse doesn't attach to the emulator directly.

The adb background process controls communication with the emulator (as well as real devices). Adb listens on TCP port 5037 for incoming commands.

I haven't tried your scenario but this should get you started.

Solution 4:

I did it with the following steps.

  1. Start the emulator on the remote machine
  2. Start a port forwarding application on the remote machine (forwarded tcp:5557 to localhost:5555)
  3. Start adb with connect remote_machine_IP:5557 on my development machine
  4. Start eclipse

Eclipse will find adb and list the device.

Solution 5:

Follow these steps to connect your VM to eclipse IDE:

First run ICS from your VM and open up android command prompt. (Navigate to applications and run Terminal Emulator)

Type "netcfg" in terminal to find out IP of your vm

Then go to cmd(windows command prompt) and move to "platform-tool" folder in your android installation path(in my case cd C:\android-sdk-windows\platform-tools)

Then type "adb connect your ip" command (adb connect 190.156.10.122)

Now you can debug your android application in vm without pain. Try this and this

Post a Comment for "Connect Eclipse To Android Emulator On A Different Machine"