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

前端 未结 11 1872
礼貌的吻别
礼貌的吻别 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:34

    I used 10.0.2.2 successfully on my home machine, but at work, it did not work. After hours of fooling around, I created a new emulator instance using the Android Virtual Device (AVD) manager, and finally the 10.0.2.2 worked.

    I don't know what was wrong with the other emulator instance (the platform was the same), but if you find 10.0.2.2 does not work, try creating a new emulator instance.

提交回复
热议问题