I am currently running android emulator(Android 1.6 api level 4) version 18 on Eclipse Indigo Service Release 2 with ADT plugin 18.0 on Debian 6.0. I am behind the university proxy(squid) with proxy address: http://172.20.0.99:8080
with no authentication.Its an eth0 connection, so no wireless/lan card issue. I have setup proxy in both environment variable and through emulator option. Also as mentioned in some previous posts I have supplied -dns-server option. My emulator run is below.
./emulator -avd "Android1_6" -dns-server "8.8.8.8" -http-proxy http://172.20.0.99:8080 -verbose
emulator: found SDK root at /opt/android-sdk-linux
emulator: Android virtual device file at: /home/dheeraj/.android/avd/Android1_6.ini
emulator: virtual device content at /home/dheeraj/.android/avd/Android1_6.avd
emulator: virtual device config file: /home/dheeraj/.android/avd/Android1_6.avd/config.ini
emulator: using core hw config path: /home/dheeraj/.android/avd/Android1_6.avd/hardware-qemu.ini
emulator: Found AVD target API level: 4
emulator: found skin 'WVGA800' in directory: /opt/android-sdk-linux/platforms/android-4/skins
emulator: autoconfig: -skin WVGA800
emulator: autoconfig: -skindir /opt/android-sdk-linux/platforms/android-4/skins
emulator: keyset loaded from: /home/dheeraj/.android/default.keyset
emulator: trying to load skin file '/opt/android-sdk-linux/platforms/android-4/skins/WVGA800/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: autoconfig: -kernel /opt/android-sdk-linux/platforms/android-4/images//kernel-qemu
emulator: autoconfig: -ramdisk /opt/android-sdk-linux/platforms/android-4/images//ramdisk.img
emulator: Using initial system image: /opt/android-sdk-linux/platforms/android-4/images//system.img
emulator: autoconfig: -data /home/dheeraj/.android/avd/Android1_6.avd/userdata-qemu.img
emulator: autoconfig: -initdata /home/dheeraj/.android/avd/Android1_6.avd/userdata.img
emulator: autoconfig: -cache /home/dheeraj/.android/avd/Android1_6.avd/cache.img
emulator: autoconfig: -sdcard /home/dheeraj/.android/avd/Android1_6.avd/sdcard.img
emulator: Physical RAM size: 128MB
Content of hardware configuration file:
hw.cpu.arch = arm
hw.ramSize = 128
hw.touchScreen = yes
hw.multiTouch = no
hw.mainKeys = yes
hw.trackBall = yes
hw.keyboard = yes
hw.keyboard.lid = yes
hw.keyboard.charmap = qwerty2
hw.dPad = yes
hw.gsmModem = yes
hw.camera = yes
hw.camera.maxHorizontalPixels = 640
hw.camera.maxVerticalPixels = 480
hw.gps = yes
hw.battery = yes
hw.accelerometer = yes
hw.audioInput = yes
hw.audioOutput = yes
hw.sdCard = yes
hw.sdCard.path = /home/dheeraj/.android/avd/Android1_6.avd/sdcard.img
disk.cachePartition = yes
disk.cachePartition.path = /home/dheeraj/.android/avd/Android1_6.avd/cache.img
disk.cachePartition.size = 66m
hw.lcd.width = 480
hw.lcd.height = 800
hw.lcd.depth = 16
hw.lcd.density = 240
hw.lcd.backlight = yes
hw.gpu.enabled = no
hw.fakeCamera = back
hw.webcam.count = 6
hw.webcam.0.name = webcam0
hw.webcam.1.name = webcam1
hw.webcam.2.name = webcam2
hw.webcam.3.name = webcam3
hw.webcam.4.name = webcam4
hw.webcam.5.name = webcam5
hw.webcam.0.direction = front
hw.webcam.1.direction = back
hw.webcam.2.direction = front
hw.webcam.3.direction = front
hw.webcam.4.direction = front
hw.webcam.5.direction = front
vm.heapSize = 24
hw.sensors.proximity = yes
hw.sensors.magnetic_field = yes
hw.sensors.orientation = yes
hw.sensors.temperature = yes
kernel.path = /opt/android-sdk-linux/platforms/android-4/images//kernel-qemu
kernel.parameters = android.checkjni=1
disk.ramdisk.path = /opt/android-sdk-linux/platforms/android-4/images//ramdisk.img
disk.systemPartition.initPath = /opt/android-sdk-linux/platforms/android-4/images//system.img
disk.systemPartition.size = 128m
disk.dataPartition.path = /home/dheeraj/.android/avd/Android1_6.avd/userdata-qemu.img
disk.dataPartition.size = 128m
avd.name = Android1_6
.
QEMU options list:
emulator: argv[00] = "./emulator-arm"
emulator: argv[01] = "-dns-server"
emulator: argv[02] = "8.8.8.8"
emulator: argv[03] = "-http-proxy"
emulator: argv[04] = "http://172.20.0.99:8080"
emulator: argv[05] = "-android-hw"
emulator: argv[06] = "/tmp/android-dheeraj/emulator-IJDCOv"
Concatenated QEMU options:
./emulator-arm -dns-server 8.8.8.8 -http-proxy http://172.20.0.99:8080 -android-hw /tmp/android-dheeraj/emulator-IJDCOv
emulator: registered 'boot-properties' qemud service
emulator: nand_add_dev: system,size=0x8000000,initfile=/opt/android-sdk-linux/platforms/android-4/images//system.img
emulator: mapping 'system' NAND image to /tmp/android-dheeraj/emulator-bhiKhz
emulator: rounding devsize up to a full eraseunit, now 8001000
WARNING: Data partition already in use. Changes will not persist!
emulator: nand_add_dev: userdata,size=0x8000000
emulator: mapping 'userdata' NAND image to /tmp/android-dheeraj/emulator-9Ay69J
emulator: rounding devsize up to a full eraseunit, now 8001000
WARNING: SD Card image already in use: /home/dheeraj/.android/avd/Android1_6.avd/sdcard.img
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'dalvik.vm.heapsize' = '24m'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '240'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '1'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'back'
DNS server name '8.8.8.8' resolved to 8.8.8.8:55
WARNING: Cache partition already in use. Changes will not persist!
emulator: nand_add_dev: cache,size=0x4200000
emulator: mapping 'cache' NAND image to /tmp/android-dheeraj/emulator-MS29Ce
emulator: Kernel parameters: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=1
waitpid(): No child processes
emulator: Trace file name is not set
emulator: autoconfig: -scale 0.888759
emulator: Realistic sensor emulation is not available, since the remote controller is not accessible:
Connection refused
emulator: emulator window was out of view and was recentered
emulator: Could not open file: : No such file or directory
emulator: control console listening on port 5556, ADB on port 5557
emulator: sent '0012host:emulator:5557' to ADB server
emulator: setting up http proxy: server=172.20.0.99 port=8080
emulator: ping program: /opt/android-sdk-linux/tools/ddms
emulator: ping command: /opt/android-sdk-linux/tools/ddms ping emulator 18.0
goldfish_fb_get_pixel_format:167: display surface,pixel format:
bits/pixel: 16
bytes/pixel: 2
depth: 16
red: bits=5 mask=0xf800 shift=11 max=0x1f
green: bits=6 mask=0x7e0 shift=5 max=0x3f
blue: bits=5 mask=0x1f shift=0 max=0x1f
alpha: bits=0 mask=0x0 shift=0 max=0x0
emulator: User configuration saved to /home/dheeraj/.android/avd/Android1_6.avd/emulator-user.ini
Clearly it was able to correctly set up proxy and reslove dns-server. When I open browser in emulator and type the hostname for e.g. http://google.com
its unable to connect(web page not available) but whereas using direct ip address(173.194.32.32) it was able to connect(google.com). I am not able to understand what went wrong. I consulted following threads too before posting and tried various solutions but no avail. What i wonder is how my desktop browser(firefox 12) able to do dns-lookup? I also tried my internal dns-servers obtained from lease file, but same results. Kindly guide me further. Even the information of how my desktop browser is able to resolve hostname will be beneficial.
I consulted many threads on stackoverflow with similar problems but cannot paste their links due to limitations by reputation.In code form:
http://developer.android.com/guide/developing/devices/emulator.html
http://stackoverflow.com/questions/2039964/how-to-connect-android-emulator-to-the-internet
http://androidcommunity.com/forums/f4/emulator-problem-34262/
http://code.google.com/p/proxoid/issues/detail?id=43
http://stackoverflow.com/questions/9876471/android-emulator-sdk-cannot-access-internet-web-page-not-available-dns-not-re
http://stackoverflow.com/questions/9812260/cant-do-reverse-dns-lookup-on-android
I have even entered proper run configuration for my project in eclipse-
-http-proxy http://172.20.0.99:8080 -dns-server 8.8.8.8
But got same results.
As this is my first post to stackoverflow community so I wanted to be as thorough as possible. Kindly do inform me of any inadequacies in my post. My sincere thanks in advance.