Search code examples
androidandroid-emulatorwifi

Testing app beetween real device and emulator via WiFi without router


I develop app which contains a client and a server side, so I need to test work between them. I have a real android device and I want android device to connects to emulator. I'm working at work sometimes(if I have free time of course) and at home. I have the WiFi router at home and I can connect to the real device by emulator(TCP listener running on the real device), but not vise versa(I don't know which exactly IP to use). But at work I have only hot-spot WiFi point without router. My android device connects to it fine. Even more ADB can connect to the device when adbWireless running on it. But it doesn't work, I can't connect to tcp listener in any cases. The difference between home and work is existence of WiFi router. Are there any solutions? If not why Android debug bridge(ADB) can connect to adbWireless? Thanks.


Solution

  • I solved the problem. I run tethering on my real device and run the server on it. Then I use a program Connection state viewer there is a link: https://play.google.com/store/apps/details?id=ru.nolesh.android.connectionstateviewer It helps me to find IP address. After that I start the emulator and the client side on it. So I connect to my server by given IP.