Emulators can access the Internet through the network of the local computer.
The emulator leverages the local computer's Ethernet or WLAN connection, sharing the same network resources. If the network connection fails, check whether local network access is restricted (for example, on a corporate intranet). If network access is restricted, configure a network proxy on the emulator by following the instructions in Network.
If a digital certificate is required to access the network, install the digital certificate by following the instructions in How do I install a digital certificate for initiating HTTPS requests.
Since the emulator's virtual Ethernet remains in a connected state, disconnecting the local computer's network or the Wi-Fi within the emulator will not put the emulator into a fully disconnected network state.
Since version 26.0.0, network disconnection simulation is supported.
Create a network server on the local computer. The emulator can access the server on the local computer through 10.0.2.2:<localPort>. 10.0.2.2 is the default gateway of the emulator.
If two emulators need to communicate with each other, perform the following steps:
hdc -t 127.0.0.1:5555 fport tcp:<localPort> tcp:<serverPort>
127.0.0.1:5555 is the HDC service port number of emulator B, which can be queried using the hdc list targets command.
