Download Android source code

Source: Internet
Author: User

http://source.android.com Step 1. Configure the Android build environment according to Http://source.android.com/source/initializing.html

http://source.android.com/source/downloading.html configuration good repo, approximate steps are as follows$ mkdir ~/bin$ Path=~/bin: $PATH$ curl Https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo$ chmod a+x ~/bin/repo$ mkdir working_directory$ CD Working_directoryThe above command is no longer explained, very simple and clear. SETP 3. Get source code from another image if you want to download the latest source code, execute: $ repo init-u git://git.omapzoom.org/platform/manifestIf you want to get each tag, such as 2.3.5, you can do it:$ repo init-u git://git.omapzoom.org/platform/manifest-b android-2.3.5_r1 If you do not know the specific tag name, then you can visit http://git.omapzoom.org in the browser, and click on the /platform/manifest link above, then you can see all the tag name. During the execution of the repo init process, you may need to fill in some personal information directly. After configuring repo, perform repo sync to download the source code you need.


Error downloading code

[HTML]View Plaincopy
    1. error:failed to connect to 2404:6800:4005:c00::52:network are unreachable while accessing https://android.googlesource.c Om/mirror/manifest/info/refs
    2. Fatal:http request failed

Workaround

1. Browser login Https://android.googlesource.com/new-password and login with Gmail account;

2. Click "Allow access" on the page to get a similar

    1. Machine android.googlesource.com login git-jacky.rg4.net password 1/dkrigevvc8o8pgg-gsm2abmns_32-u0pf0_vwkyogia
    2. Machine android-review.googlesource.com login git-jacky.rg4.net password 1/dkrigevvc8o8pgg-gsm2abmns_32-u0pf0_ Vwkyogia

3. Append the above information to the end of the ~/.netrc file (check the permissions of the current user, or create a new one yourself if the file does not exist);

4. The URI is changed to Https://android.googlesource.com/a/platform/manifest ("/A" is added to the middle).

5. Repo Init-u https://android.googlesource.com/a/platform/manifest-b ANDROID-4.0.3_R1

6. Repo Sync

You can pull down the Android source code.

The official argument is that because access is largely anonymous, there is a certain limit to the number of connections to the same IP address in order to prevent too many connections (referred to as intranet/VM). It seems to be certified with a Gmail account.

In this case, you will often encounter this problem if you download it within the corporate network or with a virtual machine.

Source Code Guide website: http://source.android.com/source/downloading.html


View Android Source version

[Plain]View Plaincopy
    1. $ grep platform_version build/core/version_defaults.mk
    2. # platform_version
    3. # Platform_version_codename
    4. Ifeq "" "$ (platform_version)"
    5. Platform_version: = 4.1.2
    6. # SDK Version The branch is based on and Platform_version_codename holds
    7. Ifeq "" "$ (platform_version_codename)"
    8. Platform_version_codename: = REL
    9. Ifeq "REL" "$ (platform_version_codename)"
    10. DEFAULT_APP_TARGET_SDK: = $ (Platform_version_codename)


Automatic repo sync to continue downloading Android source code when disconnected from the network


Symptom analysis: In the Android source code download, often will break off, at this time, you have to re-enter repo sync, then, is there a way to automatically repo sync when the network is broken?

Solution:

VI repo_sync.sh

#!/bin/bash
Repo Sync
While [$?-ne 0]
Do
Repo Sync
Done


ubuntu10.04 amd64 git version upgrade, error:exited sync due to GC errors

[Plain]View Plaincopy
      1. ubuntu10.04 appears error:exited sync due to gc  Errors workaround   
      2.    
      3. error: exited sync due  to gc errors  workaround   
      4.    
      5.   
      6. upgrade git to  1.7.2 and above,  upgrade method    
      7.    
      8. increase ppa   
      9. sudo apt-add-repository& nbsp;ppa:git-core/ppa   
      10. sudo apt-get update   
      11. sudo apt-get install git   
      12.    
      13. If you have already installed git locally, you can use the Upgrade command:    
      14. SUDO APT-GET DIST-UPGRADE  

Download Android source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.