开发者

Emulator: How do you connect to a private network?

开发者 https://www.devze.com 2023-03-04 11:17 出处:网络
My dev environment at work is a private network. I\'m running the Android emulator in this private network, but it seems to be going thru some default proxy, I\'m g开发者_如何学运维uessing to simulate

My dev environment at work is a private network. I'm running the Android emulator in this private network, but it seems to be going thru some default proxy, I'm g开发者_如何学运维uessing to simulate a carrier's network. The problem is, that since it's going thru an outside proxy, I can't test against a web service I brought up inside my private network.

My understanding of lower level networking is pretty limited. I think what I need to do is configure the emulator to use "-http-proxy " in order to bypass this default proxy that goes outside out network. However, I have no idea how to set up a proxy server. My company is very security conscious, so I'm hesitant to experiment on my own.

Anyone have any tips? Is there an easier way to get my emulator to run on my private network without setting up a proxy server?


If you are connecting to your machine, try using 10.0.2.2 for loopback (instead of 127.0.0.1, which points to the emulator itself).

Reaching private network works without limitations (or I atleast didn't notice any), connecting from another device to your emulator app requires port redirection (since the emulator is hidden behind a virtual router).

You can find more info here: http://developer.android.com/guide/developing/devices/emulator.html#emulatornetworking

0

精彩评论

暂无评论...
验证码 换一张
取 消