Android emulator with proxy settings - Error FATAL:.//android/base/sockets/ Check failed: isValidFd(fd). fd 1404 max1024

前端 未结 7 856
慢半拍i
慢半拍i 2021-01-30 14:24

need to run emulator with proxy settings , I am using the following command in command prompt to start emulator

emulator -avd AVD_for_3_7_WVGA_Nexus_One -http-p         


        
相关标签:
7条回答
  • 2021-01-30 14:42

    For some reason Android Emulator doesn't like IP address as the proxy. If you are using Fiddler use localhost:8888:

    emulator.exe -avd Nexus_5_API_21_x86 -no-audio -http-proxy localhost:8888
    

    Don't forget -no-audio parameter too.

    0 讨论(0)
  • 2021-01-30 14:48

    This problem is really frustrating. It would be nice if fixed targeting real root because most of the configurations are behind proxy now-a-days.

    I observed while researching on this problem for last couple of weeks that emulator is not stable when it comes to http-proxy.

    I installed android-studio-bundle-141.2422023-windows on one of the other m/c on that although proxy settings worked nice for http sites but failed for https sites.

    On my m/c it didn't work. I tried with all the options listed online like -no-audio or setting from APN(emulator setting), or various versions of using -http-proxy. But none is working for me.

    This is still a bug in android emulator refer link - https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=&id=102361

    0 讨论(0)
  • 2021-01-30 14:52

    Problem was fixed on latest Android SDK Tools (at the time of writing is in preview). You need version 25+ in order to get the new emulator which doesn't have this problem anymore.

    0 讨论(0)
  • 2021-01-30 14:54

    I'm experiencing the exact same issue.

    Luckily there is a workaround and I can say it's working (at least in my case): adding the -no-audio parameter to the command:

    emulator -avd <device_name> -no-audio -http-proxy http://<username:password@>IP:Port
    

    edit: even if it's working for you, please star the bug to get it fixed!

    0 讨论(0)
  • 2021-01-30 15:00

    All solutions above was unable to fix my case. For me proxy settings was required, so disabling a proxy parameter does not fit to me. The only solution that helps me is to disable "Use Host GPU" option in the emulator options. Adding "-no-audio" parameter is also required.

    And it works! Slowly, but works.

    0 讨论(0)
  • 2021-01-30 15:02

    Adding "-http-proxy none" (without quotes) in Run configuration also fixes this issue as shown in image attached. Please note this is one way of fixing this issue. Your app may not be able to connect to internet via proxy later on.

    enter image description here

    0 讨论(0)
提交回复
热议问题