简体   繁体   中英

Unable to access internet from Android Emulator from behind a proxy

I am trying to access internet from Android Emulator running Android 4.0.3. I am running Ubuntu 11.10 and am using the latest version of the SDK and tools. I have already set up the Proxy settings in the emulator using the APN, Proxy and Port provided. Although after this I could access the internet using the built in Android browser, I am unable to access internet using other app. I have tried installing Firefox mobile and Opera mobile to test this, and both the times I have failed in connecting. I have already tried the following and here is the entire detail from the emulator:

        dahaldev@ubuntu:~$ emulator -avd Phone -verbose -http-proxy http://172.30.0.10:3128
emulator: found SDK root at /home/dahaldev/android-sdk-linux
emulator: Android virtual device file at: /home/dahaldev/.android/avd/Phone.ini
emulator: virtual device content at /home/dahaldev/.android/avd/Phone.avd
emulator: virtual device config file: /home/dahaldev/.android/avd/Phone.avd/config.ini
emulator: using core hw config path: /home/dahaldev/.android/avd/Phone.avd/hardware-qemu.ini
emulator: Found AVD target API level: 15
emulator: found skin 'HVGA' in directory: /home/dahaldev/android-sdk-linux/platforms/android-15/skins
emulator: autoconfig: -skin HVGA
emulator: autoconfig: -skindir /home/dahaldev/android-sdk-linux/platforms/android-15/skins
emulator: keyset loaded from: /home/dahaldev/.android/default.keyset
emulator: trying to load skin file '/home/dahaldev/android-sdk-linux/platforms/android-15/skins/HVGA/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: autoconfig: -kernel /home/dahaldev/android-sdk-linux/system-images/android-15/armeabi-v7a//kernel-qemu
emulator: autoconfig: -ramdisk /home/dahaldev/android-sdk-linux/system-images/android-15/armeabi-v7a//ramdisk.img
emulator: Using initial system image: /home/dahaldev/android-sdk-linux/system-images/android-15/armeabi-v7a//system.img
emulator: autoconfig: -data /home/dahaldev/.android/avd/Phone.avd/userdata-qemu.img
emulator: autoconfig: -initdata /home/dahaldev/.android/avd/Phone.avd/userdata.img
emulator: autoconfig: -cache /home/dahaldev/.android/avd/Phone.avd/cache.img
emulator: autoconfig: -sdcard /home/dahaldev/.android/avd/Phone.avd/sdcard.img
emulator: Physical RAM size: 1024MB

Content of hardware configuration file:
hw.cpu.arch = arm
hw.cpu.model = cortex-a8
hw.ramSize = 1024
hw.touchScreen = yes
hw.mainKeys = yes
hw.trackBall = yes
hw.keyboard = yes
hw.keyboard.lid = no
hw.keyboard.charmap = qwerty2
hw.dPad = yes
hw.gsmModem = yes
hw.camera = no
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/dahaldev/.android/avd/Phone.avd/sdcard.img
disk.cachePartition = yes
disk.cachePartition.path = /home/dahaldev/.android/avd/Phone.avd/cache.img
disk.cachePartition.size = 66m
hw.lcd.width = 320
hw.lcd.height = 480
hw.lcd.depth = 16
hw.lcd.density = 160
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 = 48
hw.sensors.proximity = yes
hw.sensors.magnetic_field = yes
hw.sensors.orientation = yes
hw.sensors.temperature = yes
kernel.path = /home/dahaldev/android-sdk-linux/system-images/android-15/armeabi-v7a//kernel-qemu
kernel.parameters =  android.checkjni=1
disk.ramdisk.path = /home/dahaldev/android-sdk-linux/system-images/android-15/armeabi-v7a//ramdisk.img
disk.systemPartition.initPath = /home/dahaldev/android-sdk-linux/system-images/android-15/armeabi-v7a//system.img
disk.systemPartition.size = 166m
disk.dataPartition.path = /home/dahaldev/.android/avd/Phone.avd/userdata-qemu.img
disk.dataPartition.size = 66m
disk.snapStorage.path = 
avd.name = Phone
QEMU options list:
emulator: argv[00] = "/home/dahaldev/android-sdk-linux/tools/emulator-arm"
emulator: argv[01] = "-http-proxy"
emulator: argv[02] = "http://172.30.0.10:3128"
emulator: argv[03] = "-android-hw"
emulator: argv[04] = "/home/dahaldev/.android/avd/Phone.avd/hardware-qemu.ini"
Concatenated QEMU options:
/home/dahaldev/android-sdk-linux/tools/emulator-arm -http-proxy http://172.30.0.10:3128 -android-hw /home/dahaldev/.android/avd/Phone.avd/hardware-qemu.ini
emulator: registered 'boot-properties' qemud service
emulator: nand_add_dev: system,size=0xa600000,initfile=/home/dahaldev/android-sdk-linux/system-images/android-15/armeabi-v7a//system.img
emulator: mapping 'system' NAND image to /tmp/android-dahaldev/emulator-I31Kib
emulator: rounding devsize up to a full eraseunit, now a608000

emulator: nand_add_dev: userdata,size=0x4200000,file=/home/dahaldev/.android/avd/Phone.avd/userdata-qemu.img
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'dalvik.vm.heapsize' = '48m'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '160'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '1'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'back'
emulator: nand_add_dev: cache,size=0x4200000,file=/home/dahaldev/.android/avd/Phone.avd/cache.img
Warning: No DNS servers found
emulator: Kernel parameters: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=-1
emulator: Trace file name is not set

emulator: autoconfig: -scale 1
emulator: WARNING: Unable to create sensors port: Connection refused
emulator: control console listening on port 5554, ADB on port 5555
emulator: sent '0012host:emulator:5555' to ADB server
emulator: setting up http proxy:  server=172.30.0.10 port=3128
emulator: ping program: /home/dahaldev/android-sdk-linux/tools/ddms
emulator: ping command: /home/dahaldev/android-sdk-linux/tools/ddms ping emulator 16.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

Please help me with this.

从cmd尝试此命令并键入cd your / drive of sdk,然后写下面提到的行

emulator.exe -avd "EmulatorName" -dns-server "your ip Address"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM