Is there a way to access my host machine's network?
Specifically I want to scan host machines network and find devices connected to same network.
Just to clarify: from within your app, you can simply refer to the emulator as 'localhost' or 127.0. 0.1. Web traffic is routed through your development machine, so the emulator's external IP is whatever IP has been assigned to that machine by your provider.
If your emulator must access the internet through a proxy server, you can configure a custom HTTP proxy from the emulator's Extended controls screen. With the emulator open, click More , and then click Settings and Proxy. From here, you can define your own HTTP proxy settings.
In short, you can't. The simulator can only talk to the host machine. the host must provide the service to access other resources on the network.
previous text:
The android simulator is not on your home or office network.
As this was said before.. there is a small network bridge between the computer and the simulator, can you can access the host computer via the IP 10.0.2.2
.
Now to access other machines on the network, or perform a scan, you basically have two choices. either the host give you access via a tunnel.
or you join the network by some other mean. I am not sure the simulator can open a wifi connection, the device would need to be stubbed. maybe if your computer is connected via LAN cable and your wifi device delegated to the android simulator its possible.
the other choice is to use a VPN, so then every machine connected to the VPN would be on the same network.
your best bet is probably to use a real phone connected to the network via wifi.
You can access your host machine by the IP: 10.0.2.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With