1

I am trying to run an Android Emulator on my host machine which is a Mac OS and connect to it from my Vmware fusion guest machine which is a Linux.

I tried all network configurations and also tried to port forward to the 5555 port from the localhost itself thinking I will be able to connect to the host machine using the ip address and a port that is forwarded to the Android emulator port but I am either not using the right commands or that is not the actual way. I read a lot about remote adb debugging over tcp but none of those helped... It usually shows connection refused or does nt show anything at all and times out.

What am I missing? Can anyone help?

Thank you

EDIT 1 - adding steps I tried:

By all network configurations I meant that I have tried all possible network configuration options in Vmware network tab:

enter image description here

I kept switching between configurations and after they were updated and propogated to the linux guest machine, I tried connecting to (and pinging as well) the ip of the emulator. The emulator does show an internal ip of 10.0.2.16 which is an "emulated ip" I assume? Which I cant really reach. Although the image shows I'm currently using WI-FI configuration, most of the time I'm using MyNAT which is a custom NAT configuration.

enter image description here

I then tried to port forward from the mac host machine to the emulator ip and 5555 port. But still I could not reach it.

I'll add that currently the ip I get for my mac host machine (wifi - tcp) is this:

enter image description here

I'm positive this is doable I'm missing something.

EDIT 2 - SSH tunneling

I also tried variation of this command:

ssh -L 192.168.5.15:10000:localhost:5555 -N 127.0.0.1

add

ssh -L 192.168.5.15:10000:10.0.2.16:5555 -N 127.0.0.1

I tried this answer as well... But I keep getting the password request until it quits with access denied

1 Answers1

1

Ok, I finally got it to work. For anyone interested:

On host machine (Macos):

  1. adb kill-server
  2. cd /tmp
  3. mkfifo backpipe
  4. nc -kl 5555 0<backpipe | nc 127.0.0.1 5555 > backpipe

This command will forward any tcp packet received on 5555 to the local 5555 port and will forward back from local 5555 to the external 5555. Keep this terminal window open.

On guest machine (linux):

  1. adb connect mac-ip-address:5555
  2. adb devices should show the device as online.

If the devices is not authorized, make sure to accept the key request in the emulator as usual.

I can now debug on this emulator from my guest machine.