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
You can actually use localhost:8000
to connect to your machine's localhost by running below command each time when you run your emulator (tested on Mac only):
adb reverse tcp:8000 tcp:8000
Just put it to Android Studio terminal.
It basically sets up a reverse proxy in which a http server running on your phone accepts connections on a port and wires them to your computer or vice versa.