Download AOSP android-4.4.4_r2 using repo - android

I am looking to download a specific version of android source code - android-4.4.4_r2. I followed the instructions provided on the "Downloading the Source" page of android source and used repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.4_r2. And when I execute repo sync, it looks like the entire tree is getting downloaded. The current directory size of the download is 54G and is continuing to grow.
I am trying to fulfill the system requirement, as per instructions on https://github.com/huz123/GemDroid_QEMU.
Is there a different to way to download just the android-4.4.4_r2?
Or is it supposed to download the entire tree the first time (>54G)?
Please help me with the situation. Thank you!

Yes! the official documentation of hardware requirements is:
At least 100GB of free disk space for a checkout, 150GB for a single build, and 200GB or more for multiple builds. If you employ ccache, you will need even more space.
When working on the full OS system you'll have to handle large amount of data - the repo sync command can take you more than 5 hours and it's normal.
The make command that builds and compiles your project can also take some several hours on first time.

Step to download android source code(AOSP) in Ubuntu
First create one folder like "aosp-m" to copy AOSP code in your machine.
Open terminal(Ctrl+Alt+T) and change your Dir to latest created Dir let say "aosp-m"
After that Run the following command in terminal :-
git clone git://gitz01/cm/download/android/manifest
Run Following command in terminal one by one
git config --global user.name "Your Name"
git config --global user.email "you#example.com"
then run following command for repo init
repo init -u git://gitz01/cm/download/android/manifest -b master -m identifiedmanifest.xml
here you can replace identifiedmanifest.xml to your desired AOSP source code , Let Say android-6.0.1_r10.xml marshmellow.
and in the last run repo sync command. This command start downloading your desired AOSP code in your machine. This opertation take more than 1 hours(depending on your internet connection speed) to download source code.
Thats it... Happy Coding.......

Related

CM Source takes long time to download.Is there any way to reduce it?

I'm trying to build custom rom for my device from CM source.I'm following this guide to build:
https://wiki.cyanogenmod.org/w/Build_for_quark
I'm using this command to sync the source.
repo init -u https://github.com/CyanogenMod/android.git -b cm-12.1
During download i can see other branches like 7,8,9,10,11,12.Is there any way to download only current branch (12.1)?
The repo sync command is same as git clone when used without any flags, that means you are simply downloading all the branches from all the repositories defined in the manifest file (visit this and see the default.xml file).
To download only the current branch that is cm-12.1, use the -c flag while using the repo sync command. Note that the Android source is made from many projects and is a huge download when you are syncing for the first time.
So your commands should be:
repo init -u https://github.com/CyanogenMod/android.git -b cm-12.1
repo sync -c
For a better understanding of how repo tool works just read this article.
I hope this helps.

How to download only a working directory of the AOSP source code without the entire repo history?

The size of the latest AOSP source code is rather large (around 30-35 Gb for the .repo directory and another 15 Gb or so for the working directory). Is there a way to download only a snapshot of the latest version of the source code (official marshmallow release) without the entire repo history? That would save me a lot in bandwidth and storage.
You can specify --depth 1 to git clone command. It will only get the latest snapshot.
Step to download android source code(AOSP) in Ubuntu
First create one folder like "aosp-m" to copy AOSP code in your machine.
Open terminal(Ctrl+Alt+T) and change your Dir to latest created Dir let say "aosp-m"
After that Run the following command in terminal :-
git clone git://gitz01/cm/download/android/manifest
if this link not work then try this one
repo init -u https://android.googlesource.com/platform/manifest
Run Following command in terminal one by one
git config --global user.name "Your Name"
git config --global user.email "you#example.com"
then run following command for repo init
repo init -u git://gitz01/cm/download/android/manifest -b master -m identifiedmanifest.xml
if this link not work then try this one
repo init --depth=1 -u https://android.googlesource.com/platform/manifest -b identifiedmanifest.xml
here you can replace identifiedmanifest.xml to your desired AOSP source code , Let Say "android-6.0.1_r10.xml" marshmellow.
and in the last run "repo sync" command. This command start downloading your desired AOSP code in your machine. This opertation take more than 1 hours(depending on your internet connection speed) to download source code.
Thats it... Happy Coding.......
Since git version 2.19 (released in 2018), we can utilize git's --partial-clone flag via the repo tool like the following:
repo init -u https://android.googlesource.com/platform/manifest -b master --partial-clone --clone-filter=blob:limit=10M
For readers of this question and answer in 2020, be warned that the AOSP repositories have gotten bigger and the above command still results in around 73 gigabytes of source code and related files.

Android source code, I can't get real source but only bare repository

I am starting to work on Android source code in Ubuntu and even if I am expert in Android App development, this part of Android is quite new to me so apologize for any stupid questions.
I started by creating my master branch locally with the following commands:
$ mkdir master
$ cd master
$ wget http://git.[myandroidrom]/repo
$ chmod +x repo
All working as expected, I end up with a folder called master and a file called repo inside it.
Second step I started the synchronization of my source code:
$ ./repo init -u http://git.[myandroidrom]/manifest -b [my specific rom branch]
$ ./repo sync
It took a while (few hours) after I got the folder master populated with all the folders mentioned into the Android source code documentation but they are all .git folders. So quite useless because in order to compile Android I need the real source code which is somehow packed into those .git folders.
What should be the next step to extract the content of this repository?
So actually the command repo sync create a folder .repo which contains the .git structure of android. If in the repo init you don't specify with -b a branch it will download the master branch.
After that, in order to have the real code you need to git clone the folder.
Example, I run the following command:
$ repo sync build
where build is the name of my project folder and in the root working directory I have now the source code for the folder build.
More info can be found at this URL:
https://source.android.com/source/developing.html

AOSP repo sync takes too long

I'm trying to learn Embedded Android from the book with the same name. And the author suggested working with AOSP gingerbread branch. So I followed to download the source:
$ repo init -u https://android.googlesource.com/platform/manifest.git
-b gingerbread
$ repo sync
But it's taking too long. Also from the output, it seems to me like it's also downloading source code from other branches (I see android-5.....) which is not what I want. I'm wondering if that's the reason why it takes so long.
Has anybody had the same problem? Please give me a suggestion! Thanks!
AOSP is a multi-gigabyte download so there's not that much you can do. However, passing the -c/--current-branch option to repo sync causes Repo to tell Git to only fetch the branch you really need instead of all branches of each repository. With an old release like Gingerbread this should theoretically be quite beneficial. However, Repo seeds the repositories with Git bundles that it downloads via HTTP, and the bundle files aren't affected by the -c option. Using --no-clone-bundle disables the bundle files. Hence the following Repo command should yield the smallest download:
repo sync -c --no-clone-bundle
(Keep in mind that Gingerbread is a several year old release. It won't work out of the box on a lot of recent hardware.)
You should use this commands:
Example: for my personal AOSP Repo,
repo init --depth=1 -u https://github.com/zawzaww/aosp-android.git -b android-8.1.0
and then,
repo sync -f --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
You can learn more on my GitHub Repo
repo init --depth 1
This is another option that might improve sync speed, as it should only download the latest version of the repos.
See also: https://superuser.com/questions/603547/how-can-i-limit-the-size-of-the-android-source-i-need-to-download-with-repo-syn
Here are my full test commands: How to compile the Android AOSP kernel and test it with the Android Emulator?
repo sync -c --no-tags --no-clone-bundle -j2
Shortens my sync times greatly.

Ubuntu - How to commit a whole Android project to a local respository?

Being fairly new to Linux and very new to Git, this is proving to be.. problematic.
Can someone please direct me to or tell me the steps required (Ideally step by step) to do this?
I have a directory with my project in it, I want to commit that to Git, I know there is a .gitignore which ignores certain files etc. and I have used GitHub on Windows mainly for local respository stuff which is again the primary purpose now.
Any help on this would be greatly appreciated cheers!
Welcome to git and linux. Here are a few links to get you started
https://help.github.com/articles/set-up-git
http://git-scm.com/book
http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository
http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html
Git for beginners: The definitive practical guide
There are a couple of different ways to do this. The easiest in my opinion is the command line.
Open up a terminal, and cd to the directory that contains the android project.
cd /home/bob/foo
ls
Initialize the git repo, this will create a hidden .git file inside the folder
git init
ls -a
Create your first commit, by adding all files to the working tree
git add .
git commit -m "My First Commit"
You will now have a master branch, and 1 commit. You can veiw your commit with the following commands
git status
git log
If you aren't comfortable using the command line yet, you could alternatively accomplish all of this with a gui. Here are some programs for linux.
https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools#Graphical_Interfaces
You can do a simple
git init
in the command line (in the correct directory) to initialize your local repository. Then you just have to add your files and commit them :
git add .
git commit -m "first commit"
I strongly recommand you the read of the first chapters (at least) of the Pro Git free book to help you understand the basics.

Categories

Resources