How to connect to my http://localhost web server from Android Emulator

前端 未结 11 1864
礼貌的吻别
礼貌的吻别 2020-11-22 02:03

What can I do in the Android emulator to connect it to my localhost web server page at http://localhost or http://127.0.0.1?

I\'ve tried it

11条回答
  •  被撕碎了的回忆
    2020-11-22 02:16

    I needed to figure out the system host IP address for the emulator "Nox App Player". Here is how I figured out it was 172.17.100.2.

    1. Installed Android Terminal Emulator from the app store
    2. Issue ip link show command to show all network interfaces. Of particular interest was the eth1 interface
    3. Issue ifconfig eth1 command, shows net as 172.17.100.15/255.255.255.0
    4. Begin pinging addresses starting at 172.17.100.1, got a hit on `172.17.100.2'. Not sure if a firewall would interfere but it didn't in my case

    Maybe this can help someone else figure it out for other emulators.

提交回复
热议问题