Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Android SDK manager with socks?

The default proxy of Android SDK manager (android-sdk-manager) is HTTP, but the problem is how can I use it with SOCKS (My OS is Windows 7)?

like image 871
PodBlood Avatar asked Jun 11 '15 14:06

PodBlood


1 Answers

JVM has environment variable for proxy.

[Linux]

export _JAVA_OPTIONS="-DsocksProxyHost=<YourProxyHost>"

[Windows]

set _JAVA_OPTIONS="-DsocksProxyHost=<YourProxyHost>"

Default port for socks proxy is 1080, If you are running your proxy in another port you have to tell jvm which port is it.

[Linux]

 export _JAVA_OPTIONS="-DsocksProxyHost=<YourProxyHost> -DsocksProxyPort=<YourProxyPort>"

[Windows]

set _JAVA_OPTIONS="-DsocksProxyHost=<YourProxyHost> -DsocksProxyPort=<YourProxyPort>"

And run android sdk manager in current session.

[Linux]

 bash /path/to/sdk/tools/android

[Windows]

 c:\path\to\android.exe

You will see something like this at the start:

[Linux]

 Picked up _JAVA_OPTIONS: -DsocksProxyHost=<YourProxyHost>
like image 59
Mohammad Niknam Avatar answered Sep 28 '22 15:09

Mohammad Niknam