Hello,
Emulated device can't detect your development machine or other emulator instances on the network. It detects only that it is connected through ethernet to a router or firewall. The virtual router for each instance manages the 10.0.2/24 network address space. All addresses managed by the router are in the form of 10.0.2.xx, where xx is a number. Addresses within this space are pre-allocated by the emulator or router as follows:
From Google emulator network addresses document, you can set the 10.0.2.xx to replace localhost
.
Or please use android devices and connect to the same network environment.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.