问题
I've read a bunch of articles on SO and around the web that all tell me that the android emulator connects to my machine with the ip address 10.0.2.2
when using localhost
. Unfortunately I'm not using localhost
, I've edited my hosts file so that I connect to local.blah.com
when I want to view my webpage.
I thought that if I write: 10.0.2.2 local.blah.com
in my host file it would allow my to see the webpage I am developing in the android emulator. (Please correct me if this was not a good assumption)
So My question is what else can I try to get my local.
url to work on the android emulator.
回答1:
You either set up a local DNS server, or else you can only use the IP address, which should work.
来源:https://stackoverflow.com/questions/8844576/connect-to-my-wamp-server-with-the-android-emulator-with-local-web-address