How to get the Android Emulator's IP address?


I want to get the currently running Android Emulator's IP address through code. How can it be achieved?

11/5/2012 1:29:39 PM

Accepted Answer

Just to clarify: from within your app, you can simply refer to the emulator as 'localhost' or

Web traffic is routed through your development machine, so the emulator's external IP is whatever IP has been assigned to that machine by your provider. The development machine can always be reached from your device at

Since you were asking only about the emulator's IP, what is it you're trying to do?

11/12/2009 2:07:13 PM

If you do truly want the IP assigned to your emulator:

adb shell
ifconfig eth0

Which will give you something like:

eth0: ip mask flags [up broadcast running multicast]

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow