Hovatek Forum DEVELOPMENT Android [Tutorial] How to download Android source in Ubuntu
Can't login? Please, reset your password.
Hovatek is recruiting! Apply Now


[Tutorial] How to download Android source in Ubuntu

[Tutorial] How to download Android source in Ubuntu

hovatek
hovatek
hovatek
Administrator
49,566
08-01-2015, 02:35 AM
#1



First of all, you need to have Ubuntu setup (for Windows users, see https://www.hovatek.com/forum/thread-1004.html )

Installing Repo

To install Repo, Launch the Terminal (Ctrl+Alt+T)

1. Make sure you have a bin/ directory in your home directory and that it is included in your path:

Code:

$ mkdir ~/bin
$ PATH=~/bin:$PATH

2. Download the Repo tool and ensure that it is executable:

Code:

$ sudo apt-get install curl
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo


Initializing a Repo client

After installing Repo, set up your client to access the Android source repository:

1. Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive file system. Give it any name you like:

Code:

$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY

2a. Install Git. After it finishes downloading, you will have Git installed and ready to use.

Code:

sudo apt-get install git-core

2b. Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.

Code:

$ repo init -u https://android.googlesource.com/platform/manifest

For CyanogenMod sources, use

Code:

$ repo init -u git://github.com/CyanogenMod/android.git -b cm-12.0

3. When prompted, configure Repo with your real name and Gmail address using

Code:

git config --global user.email YourEmail
git config --global user.name YourName

To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.

Downloading the Android Source Tree

To pull down the Android source tree to your working directory from the repositories as specified in the default manifest, run

Code:

$ repo sync

you could also use

Code:

repo sync -c -j4

Where:
-j instruct repo to download several projects in parallel (making it faster). You should tune the number of jobs repo will launch in paralell with regards of your number of CPU cores, and your bandwidth. -j 16 should be fine for a 8-cores box with a high Internet bandwidth.

-c  Ensures repo will only download the revision (branch) that is specified in the manifest, not all the branches that are on the remote server. It will thus save us quite some space, and again it will take less time to download.
This post was last modified: 12-01-2015, 10:36 PM by hovatek.

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
suheli
suheli
suheli
Techie Member
79
11-02-2015, 04:34 PM
#2
how can i create a bin directory in my home directory
hovatek
hovatek
hovatek
Administrator
49,566
11-02-2015, 07:24 PM
#3
(11-02-2015, 04:34 PM)suheli how can i create a bin directory in my home directory

thats what the first command does

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
YtWhTl
live chat
whatsapp telegram instagram