Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to a http server running in android emulator?

I have a HTTP server working on my android emulator listening to port 8080. How can I connect to it from same PC's browser? I tried 127.0.0.1 but it couldn't connect.

like image 307
Rahul K Avatar asked Feb 04 '13 10:02

Rahul K


1 Answers

You have to enable port forwarding in adb. For example:

adb forward tcp:8080 tcp:8080

This will forward incoming connections to localhost TCP/8080 to the emulator TCP/8080.

Here's the reference.

like image 129
m0skit0 Avatar answered Sep 21 '22 03:09

m0skit0