Thursday, August 2, 2012

Downloading the Android sources behind a proxy

Manual for Windows
Setup

The simplest way to get the Source Tree for Windows is to use Cygwin

1.       Download Cygwin web installer from http://cygwin.com/install.html and run it
2.       You can install packages from Internet using IE proxy settings
3.       Specify the root directory – things will be easier if the path to it won’t contain spaces
4.       In addition to default packages you will need the following:  bash, curl, git and python. The installer will automatically resolve the dependencies.
5.       After installation you will have “Cygwin bash shell” link in Main Menu. Run it
6.       Type cd in command prompt to be sure you are in your home dir – usualy it is your “My Documents”
7.       Create file .bash_profile in this dir with following contents:
export PATH=/usr/bin:~/bin:$PATH
export http_proxy=proxy:port
proxy:port is name and port of your proxy server
8.       Reopen the Cygwin shell and cd to your home dir


Installing a Repo client
Type the following commands in the Cygwin terminal:
mkdir ~/bin
curl --insecure --proxy proxy:port https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo


Configuring Git
Type the following commands in the shell:
git config --global http.sslverify "false"
git config --global http.proxy "proxy:port"

Getting the files
Now you can follow instructions from http://source.android.com/source/downloading.html 

Manual for Linux
Setup  
  • Add the following line to the .bashrc in your home directory, replace proxy and port with your settings: 
export PATH=~/bin:$PATH
export http_proxy=proxy:port 
  • Run  
source .bashrc

Installing a Repo client

Type the following commands in the shell

mkdir ~/bin
curl --proxy proxy:port https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/rep

Configuring Git

Add proxy to Git
git config --global http.proxy "proxy:port"

Getting the files
Now you can follow instructions from http://source.android.com/source/downloading.html 

No comments:

Post a Comment