Genymotion is used for Android testing. genymotion is run in virtualbox. virtualbox establishes a connection between the two. in Linux, ifconfig shows a virtual network card called vboxnet0, the IP address is 192.168.56.1. The address allocated by Android in genymotion is 192.168.56.101.
You need to access the loopback On the host. in the simulator, the access is successful through 192.168.56.1 or 10.0.3.2. (Google simulator uses 10.0.2.2)
The premise is that WiFi is enabled in the simulator, which is enabled by default.
I successfully accessed the server through 10.0.3.2, but it was previously a big headache. I first failed to access the server I wrote through 127.0.0.1 on my computer. I checked the network port, firewall, and iptables rules, after a large circle, we found that the IP address bound to the original server was not 127.0.0.1, but a static IP address set by ourselves, such as 192.168.1.5. Access to 192.168.1.5 on the computer was successful, but not in the simulator.
Finally, the solution is found on stack overflow.
A python file directory browser is attached below to create a simple file directory:
$ Python-M simplehttpserverserving HTTP on 0.0.0.0 port 8000
You can use this to conveniently Check network connectivity.
Genymotion accesses the computer's localhost