Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android SDK Manager Proxy Settings in LINUX

I am trying to install the Android SDK, in Ubuntu, behind my work firewall and am getting 'failed to connect to dl-ssl.google.com' messages. This is a known problem but every solution I see involves proxy settings and selecting the 'force http' option. It appears that this is straightforward in windows, however I'd like to know how to do the same in LINUX. I can set the eclipse proxy settings but I don't think this gets used by the android sdk manager. Is there a config file somewhere?

Thanks in advance.

Marc

like image 759
user1400716 Avatar asked May 17 '12 10:05

user1400716


People also ask

Where is Android SDK in Linux?

Linux: ~/Android/Sdk. Mac: ~/Library/Android/sdk. Windows: %LOCALAPPDATA%\Android\sdk.

Where is proxy settings in Android Studio?

To set the HTTP proxy settings in Android Studio: From the menu bar, click File > Settings (on macOS, click Android Studio > Preferences). In the left pane, click Appearance & Behavior > System Settings > HTTP Proxy. The HTTP Proxy page appears.

How do I open sdk manager in terminal?

From Eclipse (with ADT), select Window > Android SDK Manager. On Windows, double-click the SDK Manager.exe file at the root of the Android SDK directory. On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute android sdk .


2 Answers

The solution was to setup a local proxy to perform authentication and create the file ~/.android/androidtool.cfg to redirect android to the local proxy as follows.

### Settings for Android Tool
#Tue Jun 12 01:34:55 PDT 2012
http.proxyPort=3128
sdkman.monitor.density=108
http.proxyHost=127.0.0.1
sdkman.show.update.only=true
sdkman.ask.adb.restart=false
sdkman.force.http=true
sdkman.show.updateonly=true

This file may already exist with entries such as

http.proxyPort=
http.proxyHost=127.0.0.1\:3128

For me, this did not work until I changed it to the form shown above:

http.proxyPort=3128
http.proxyHost=127.0.0.1
like image 94
user1400716 Avatar answered Nov 09 '22 15:11

user1400716


Just to help someone out there.

I was able to use SDK Manager with Proxy settings with following procedure

  1. Goto Shell (Ctrl+Alt+T for ubuntu)
  2. Run "android" from the sdk\tools directory. (example /mySDKDir/tools/android)
  3. This would launch the SDK Manager. On the Main menu, goto Tools -> Options to setup the proxy settings.
  4. Select the relevant packages and download/install. SDK Manager would use the proxy settings specified.

Regards

like image 45
Ali Habiby Avatar answered Nov 09 '22 15:11

Ali Habiby