How to connect to localhost from Android Studio emulator

▼魔方 西西 提交于 2019-12-01 21:02:48

You're going to need to connect to your computer's IP.

If you're on Windows open CMD and type ipconfig this will give you your local IP.

If you're on Linux or OSX open terminal and use the ifconfig command.

Since the emulator is a full Android device it has its own network and doesn't use the same hosts file that your machine has. Along with its own IP.

Edit: Grammar fix.

I use my local ip for that i.e. 192.168.0.1 and it works. Verify your local IP.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!