Martynas Jurkus
Martynas Jurkus

Reputation: 9301

How to access host machine's network from android emulator

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.

Upvotes: 6

Views: 4276

Answers (2)

Mathieu J.
Mathieu J.

Reputation: 2115

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.

Upvotes: 5

regev avraham
regev avraham

Reputation: 1112

You can access your host machine by the IP: 10.0.2.2

Upvotes: 3

Related Questions