Aalok Sharma
Aalok Sharma

Reputation: 1025

Have the same IP address for android emulator and Host PC

I would like to know that is there any way we can configure the android emulator to use the same IP address as the Host machine(in my case a Windows machine) by default ? And if yes, than how do I configure that ?

Any help is greatly appreciated.

Upvotes: 1

Views: 3496

Answers (1)

Robin
Robin

Reputation: 10368

I guess the purpose is that you want to connect to your emulator from out side devices.

But this is not called "have the same IP with host PC", you might want to configure the network to bridged mode in your emulator. Thus you can get an IP address which is in the same subnet of your host PC.

However, I would like you to try a better way to achieve the same goal, check this:

adb forward <local> <remote> - forward socket connections
                               forward specs are one of:
                                 tcp:<port>
                                 localabstract:<unix domain socket name>
                                 localreserved:<unix domain socket name>
                                 localfilesystem:<unix domain socket name>
                                 dev:<character device name>
                                 jdwp:<process pid> (remote only)

Upvotes: 1

Related Questions