Note
The following methods only applies if Genymotion Desktop and your server/service run on the same host machine.
With VirtualBox
To reach a local host service from the virtual device, use the IP address 10.0.3.2.
- The IP address 10.0.3.2 is a VirtualBox alias to your host loopback interface (i.e., 127.0.0.1 on your host machine).
- For example, if you run a service on your host machine which listens to localhost:1234, it can be accessed from the virtual device using the IP 10.0.3.2:1234.
With QEMU
Unlike VirtualBox, there is no loopback interface when using QEMU. However, it is possible to use adb reverse to bind a virtual device local port to a host local port.
- For example, if you run a service on your host machine that listens to localhost:1234, then use the command:
adb reverse tcp:1234 tcp:1234
- This will bind the virtual device local TCP port 1234 to your host machine local TCP port 1234. Thus, the service can be accessed from the virtual device using the IP localhost:1234.