Install Android SDK thru Proxy with Authentication

Today I was trying to download and install additional SDK R5 components from Internet using the Android SDK and AVD Manager tool. Initially, the download was continuously failed, because, my system is behind a Proxy, which need an authentication. Android SDK and AVD Manager does not provide any option in the proxy settings, to include the proxy authentication (user name and password) details.

So I decided to run my own proxy server locally and configure it to talk to the parent (original) proxy server with authentication detail. Initially, I decided NOT to run the heavy weight proxy Squid and selected TinyProxy for this purpose. But TinyProxy not supported the Authentication feature. So finally ended up running Squid proxy with following configurations:

# Listen only local interface

# Parent proxy ( and Authentication settings
cache_peer parent 8080 0 no-query default login=User:Passwd

# No direct access
never_direct allow all

After restarting the Squid, I changed the proxy settings of Android SDK and AVD Manager to:

Port: 3128

After this, restarted it. Now the additional components are successfully downloaded.

26 thoughts on “Install Android SDK thru Proxy with Authentication

  1. OK, I got it, but after configuring it, I still get Authentication Failed on the android SDK. Any ideas? Maybe post the whole config file for squid?

  2. From the browser, Is it possible for you to goto Internet using the User:Passwd, which is mentioned in squid conf file.

  3. After much messing around, I managed to get this working really easily.Edit android.bat, and in the call to java.exe, insert the following parameters VM parameters before -jar-Dhttp.proxyUsername="username" -Dhttp.proxyPassword="password"Note that there’s no space between D and http. You still need to put in the host/port in the settings.

  4. !!!Thank you Shane! Turns out, for the Linux SDK, it’s the very last line of the "tools/android" that these settings belong in.It was a super easy thing to patch… I should probably make those two fields available as command-line options to "android" and see if Google is interested in that feature. It is certainly the best way to make the updater useful behind an authenticated web proxy.

  5. I’m also behind a proxy but we use automatic proxy configuration url. Any idea on how to configure android.bat to use the conf url? thanks!

  6. Hi, I just moved into Android 2.2 and the problem was solved. Also let me tell you that in my company have 2 proxies and 1 scripted proxy. I tried with one of the proxies and it didn’t work and with the other worked perfectly. I would recommend to talk with your tech support and see what options they have for you. BTW according to google support proxy definitively doesnt work in 2.1.

  7. im using your freedom for bypassing the proxy and the installation runs fine but it stops at 93%, i dont know if its a problem just on my connection. u can try it to if it works for u all.

  8. Start Manager and set proxy name and port in "settings" tab.Don’t put "HTTP" before proxy name.Edit android.bat file and change the lines before SetPath:rem Finally exec the java program and end %java_exe%"%tools_dir%" -Dhttp.proxyUsername="DOMAINUSER" -Dhttp.proxyPassword="PASSWORD" -classpath "%jar_path%;%swt_path%swt.jar" %* PIETRO

  9. I tried a lot but can not be able to solve this problem I am in a college where proxy server is running with user name and password authorization pls send me a modified android.bat file at this e-mail address pls sir thanks in advance

  10. I have the same issue, after install eclipse works just find…. with eclipse you can provide user and pass word for your proxy. Then download ADT Plugin for Eclipse.Now you are able to work.RegardsMario Bedeschi

  11. @ Pietro @Dan @sc @Droid I am not sure but I think you meant AFTER ":SetPath" because what’s before it is not identical with the lines you provided. I assumed it is After, and now the end of my .bat file looks like this (after replacing the original lines that come after SetPath with the ones U suggested):_________________:SetPathrem Finally exec the java program and end %java_exe%"%tools_dir%" -Dhttp.proxyUsername="XXXXXX" -Dhttp.proxyPassword="XXXXXX" -classpath "%jar_path%;%swt_path%swt.jar" %*rem EOF__________________Yet this gives me "access is denied". Questino is, after Dhttp.proxyUsername should I only input the username, or the domain followed by the username? In what format should that be? Thanx

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: