Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the IP address of android emulator, [duplicate]

Tags:

android

What is the IP address of android emulator, by what I found SEVERAL information on the internet, 127.0.0.1, 10.0.0.2 or 10.0.015 to call the emulator from web server (apache). is that the port of the emulator is fixed?

like image 877
user2282259 Avatar asked Dec 15 '22 11:12

user2282259


2 Answers

  • 10.0.2.1 - Router/gateway address
  • 10.0.2.2 - Special alias to your host loopback interface (i.e., 127.0.0.1 on your development machine)
  • 10.0.2.3 - First DNS server
  • 10.0.2.4 / 10.0.2.5 / 10.0.2.6 - Optional second, third and fourth DNS server (if any)
  • 10.0.2.15 - The emulated device's own network/ethernet interface
  • 127.0.0.1 - The emulated device's own loopback interface

http://developer.android.com/tools/devices/emulator.html

like image 90
Piyush Machhoya Avatar answered Feb 03 '23 17:02

Piyush Machhoya


Use this method you will be getting 100% correct ip address for your android emulator

To get the ip address of yoor emulator

Go to adb shell and type this command

adb shell
ifconfig eth0

enter image description here

After running this command I am getting

IP : 10.0.2.15

Mask : 255.255.255.0

Which works for me . I am also working for an networking application.

like image 25
Nikhil Agrawal Avatar answered Feb 03 '23 18:02

Nikhil Agrawal