1

For server apps I meant e.g. kWS, or Tiny Web Server.


I'm trying to fully understand Android Emulator's virtual routing setup, so that hopefully I will be able to test networked apps with emulators in the future.

I'm following the linked guide's "interconnecting emulator instances" section for example:

  • A is my development machine
  • B is my first emulator instance, running on A

I see that I can open 10.0.2.2 in emulator B's browser, to access a server running on A.

I also see that I can telnet to emulator B, to set redir rules so requests to A can be routed to emulator B.


However, when trying to connect from A, to a server running on emulator B,

I realized that I wasn't able to launch server apps installed to emulator B and make them listen to 10.0.2.15.

As a result, I wasn't able to test and make sure my redir rules work.

Is this intended behavior for Android AVD emulators? Or did I miss something?

Must I develop my own app to listen to 10.0.2.15 regardless of the emulator's ethernet IP, and test with redir rules from A to B?

Or is there a way to launch server apps like kWS to listen to 10.0.2.15, perhaps by configuring emulator B to show 10.0.2.15 in adb shell's ifconfig (wlan0) instead of 192.168.xx.xx?


My emulators (B,C) both show different IPs with prefix 192.168.xx.xx (different subnets, irrelevant to my local LAN setups, nor are they related to A's physical/virtual ethernet adapter setups).

Any insight would be appreciated; thanks!

Noice2D
  • 74
  • 5

1 Answers1

0

I found out that I can use "adb forward" to forward requests to machine A to emulator B. Source: How to connect to a http server running in android emulator?

This way, I should be able to setup a static environment to test networking functionalities between two emulator instances. Each will have to connect to A's ports to get forwarded to the other.

Still not sure this is the best way; I think it'd be best to be able to type 10.0.2.15:port in emulator B's browser and get access to its own server.

Noice2D
  • 74
  • 5