How to set proxy for android sdk manager?

前端 未结 3 917
轮回少年
轮回少年 2021-01-04 07:11

I am behind a proxy and need to set up SDK manager for the android virtual device. But SDK manager is unable to download any os images/SDK updates from the add-on lists prob

3条回答
  •  抹茶落季
    2021-01-04 07:12

    Installation of android SDK (on windows 7 with proxy authetication) Command Line syntax to use proxy settings.

    1. Edit %ANDROID_HOME%/tools/bin/sdkmanager.bat.

      Add -Dhttp.proxyUsername="MyUser" -Dhttp.proxyPassword="MyPass" on "%JAVA_EXE%". I have something like this:

      @rem Execute sdkmanager
      "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %SDKMANAGER_OPTS% -Dhttp.proxyUsername="MyUser" -Dhttp.proxyPassword="MyPass" -classpath "%CLASSPATH%" com.android.sdklib.tool.sdkmanager.SdkManagerCli %CMD_LINE_ARGS%
      
    2. Install your packages for the Android SDK, just add --proxy=http --proxy_host= --proxy_port=. I have something like this:

    "%ANDROID_HOME%\tools\bin\sdkmanager" "emulator" "platform-tools" "platforms;android-25" "build-tools;27.0.3" "extras;android;m2repository" "extras;google;m2repository" --proxy=http --proxy_host=pftwbappp04-wcg.mycompany.com.pe --proxy_port=8080
    

提交回复
热议问题