How to configure Android SDK manager with socks?

2k views Asked by At

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

2

There are 2 answers

1
Mohammad Niknam On BEST ANSWER

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>
0
Mohannd On

Niknam answer is perfect, and I want to add if you use TOR add in your environment

export _JAVA_OPTIONS="-DsocksProxyHost=127.0.0.1 -DsocksProxyPort=9050"