JVM has a proxy environment variable.
[Linux]
export _JAVA_OPTIONS="-DsocksProxyHost=<YourProxyHost>"
[Windows]
set _JAVA_OPTIONS="-DsocksProxyHost=<YourProxyHost>"
The default port for the socks proxy server is 1080. If you are using your proxy server in a different port, you need to specify jvm, which is the port.
[Linux]
export _JAVA_OPTIONS="-DsocksProxyHost=<YourProxyHost> -DsocksProxyPort=<YourProxyPort>"
[Windows]
set _JAVA_OPTIONS="-DsocksProxyHost=<YourProxyHost> -DsocksProxyPort=<YourProxyPort>"
And run the sdk manager for Android in the current session.
[Linux]
bash /path/to/sdk/tools/android
[Windows]
c:\path\to\android.exe
In the beginning you will see something like this:
[Linux]
Picked up _JAVA_OPTIONS: -DsocksProxyHost=<YourProxyHost>
source
share