I created a directory "Test".
Did below steps:
repo init -u https://android.googlesource.com/platform/manifest
repo sync
When sync was complete, there were no files in my "Test" directory.
Can somebody help me with source code location?
double check with the online tutorial Downloading the Source.
1. was your network connection OK?
2. Did you cd to Test?
3. try to repo a branch
4. use "find" command to search
Related
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.......
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.
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.
I have already downloaded Android source code using
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
Now I want to create a mirror for other people to access over LAN
repo init -u https://android.googlesource.com/mirror/manifest --mirror
Can I copy already downloaded source inside mirror dir so that download usage will be low?
I think yes, you can. The only thing that you should do is to correct manifest file. For instance, you can read here how to do this.
When I give these commands then the 2.3.7 branch gets initialized in current directory and source gets downloaded.
repo init -u https://android.googlesource.com/platform/manifest -b android-2.3.7_r1
repo sync
Thereafter if I give following command what exactly happens
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
or
repo init -u https://android.googlesource.com/platform/manifest
My Questions
Will my earlier branch be deleted which I have downloaded with great difficulty? Cant I have multiple branches existing simultaneously?
If I can have more than one branch then how to access them? I dont see any directory called 2.3.7 or 4.0.1.
The repo directory structure is very confusing. Can anybody guide?
You should start a new repo branch within the same source code branch
repo start BRANCH_NAME [PROJECT_LIST]
Also refer to the following book on how to switch and make use to features in git
Look at section on branching and merging. Create branch using repo and then git commands to move around
You should do a repo init in a different directory. repo init clones the git structure specified by the manifest file
e.g
android/gingerbread/repo init
android/eclair/repo init
I see that you want to sync a new branch while using the files downloaded at previous sync to save download time.
create a new directory
copy the .repo file (hidden) from the old branch_folder (gingerbread in your case) to a new directory
cd into that directory
Finally you can do:
repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1
repo sync