红联Linux门户
Linux帮助

安卓系统学习--获取Google安卓系统源码

发布时间:2015-10-24 10:41:31来源:linux网站作者:牧羊_人

1.安装git curl
sudo apt-get install git-core curl

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

3.$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmoda+x /bin/repo4. mkdir -p workspace/android/android4.4.2

$ cd workspace/android/android4.4.2

$ git clone https://android.googlesource.com/platform/manifest.git

安卓系统学习--获取Google安卓系统源码

$ cd manifest/

$ git branch -a

lhy@Ubuntu:~/workspace/android/android4.4.2/manifest$ git branch -a

安卓系统学习--获取Google安卓系统源码


* master
remotes/origin/HEAD -> origin/master
remotes/origin/adt_23.0.3
remotes/origin/android-1.6_r1
remotes/origin/android-1.6_r1.1
remotes/origin/android-1.6_r1.2
remotes/origin/android-1.6_r1.3
remotes/origin/android-1.6_r1.4
remotes/origin/android-1.6_r1.5
remotes/origin/android-1.6_r2
remotes/origin/android-2.0.1_r1
remotes/origin/android-2.0_r1
remotes/origin/android-2.1_r1
remotes/origin/android-2.1_r2
remotes/origin/android-2.1_r2.1p
remotes/origin/android-2.1_r2.1p2
remotes/origin/android-2.1_r2.1s
remotes/origin/android-2.2.1_r1
remotes/origin/android-2.2.1_r2
remotes/origin/android-2.2.2_r1
remotes/origin/android-2.2.3_r1
remotes/origin/android-2.2.3_r2
remotes/origin/android-2.2.3_r2.1
remotes/origin/android-2.2_r1
remotes/origin/android-2.2_r1.1
remotes/origin/android-2.2_r1.2
remotes/origin/android-2.2_r1.3
remotes/origin/android-2.3.1_r1
remotes/origin/android-2.3.2_r1
remotes/origin/android-2.3.3_r1
remotes/origin/android-2.3.3_r1.1
remotes/origin/android-2.3.4_r0.9
remotes/origin/android-2.3.4_r1
remotes/origin/android-2.3.5_r1
remotes/origin/android-2.3.6_r0.9
remotes/origin/android-2.3.6_r1
remotes/origin/android-2.3.7_r1
remotes/origin/android-2.3_r1
remotes/origin/android-4.0.1_r1
remotes/origin/android-4.0.1_r1.1
remotes/origin/android-4.0.1_r1.2
remotes/origin/android-4.0.2_r1
remotes/origin/android-4.0.3_r1
remotes/origin/android-4.0.3_r1.1
remotes/origin/android-4.0.4_r1
remotes/origin/android-4.0.4_r1.1
remotes/origin/android-4.0.4_r1.2
remotes/origin/android-4.0.4_r2
remotes/origin/android-4.0.4_r2.1
remotes/origin/android-4.1.1_r1
remotes/origin/android-4.1.1_r1.1
remotes/origin/android-4.1.1_r2
remotes/origin/android-4.1.1_r3
remotes/origin/android-4.1.1_r4
remotes/origin/android-4.1.1_r5
remotes/origin/android-4.1.1_r6
remotes/origin/android-4.1.1_r6.1
remotes/origin/android-4.1.2_r1
remotes/origin/android-4.1.2_r2
remotes/origin/android-4.1.2_r2.1
remotes/origin/android-4.2.1_r1
remotes/origin/android-4.2.1_r1.1
remotes/origin/android-4.2.1_r1.2
remotes/origin/android-4.2.2_r1
remotes/origin/android-4.2.2_r1.1
remotes/origin/android-4.2.2_r1.2
remotes/origin/android-4.2.2_r1.2b
remotes/origin/android-4.2_r1
remotes/origin/android-4.3.1_r1
remotes/origin/android-4.3_r0.9
remotes/origin/android-4.3_r0.9.1
remotes/origin/android-4.3_r1
remotes/origin/android-4.3_r1.1
remotes/origin/android-4.3_r2
remotes/origin/android-4.3_r2.1
remotes/origin/android-4.3_r2.2
remotes/origin/android-4.3_r2.2-cts
remotes/origin/android-4.3_r2.3
remotes/origin/android-4.3_r3
remotes/origin/android-4.3_r3.1
remotes/origin/android-4.4.1_r1
remotes/origin/android-4.4.1_r1.0.1
remotes/origin/android-4.4.2_r1
remotes/origin/android-4.4.2_r1.0.1
remotes/origin/android-4.4.2_r2
remotes/origin/android-4.4.2_r2.0.1
remotes/origin/android-4.4.3_r1
remotes/origin/android-4.4.3_r1.0.1
remotes/origin/android-4.4.3_r1.1
remotes/origin/android-4.4.3_r1.1.0.1
remotes/origin/android-4.4.4_r1
remotes/origin/android-4.4.4_r1.0.1
remotes/origin/android-4.4.4_r2
remotes/origin/android-4.4.4_r2.0.1
remotes/origin/android-4.4_r1
remotes/origin/android-4.4_r1.0.1
remotes/origin/android-4.4_r1.1
remotes/origin/android-4.4_r1.1.0.1
remotes/origin/android-4.4_r1.2
remotes/origin/android-4.4_r1.2.0.1
remotes/origin/android-4.4w_r1
remotes/origin/android-5.0.0_r1
remotes/origin/android-5.0.0_r1.0.1
remotes/origin/android-5.0.0_r2
remotes/origin/android-5.0.0_r2.0.1
remotes/origin/android-5.0.0_r3
remotes/origin/android-5.0.0_r3.0.1
remotes/origin/android-5.0.0_r4
remotes/origin/android-5.0.0_r4.0.1
remotes/origin/android-5.0.0_r5
remotes/origin/android-5.0.0_r5.0.1
remotes/origin/android-5.0.0_r5.1
remotes/origin/android-5.0.0_r5.1.0.1
remotes/origin/android-5.0.0_r6
remotes/origin/android-5.0.0_r6.0.1
remotes/origin/android-5.0.0_r7
remotes/origin/android-5.0.0_r7.0.1
remotes/origin/android-5.0.1_r1
remotes/origin/android-5.0.2_r1
remotes/origin/android-5.0.2_r3
remotes/origin/android-5.1.0_r1
remotes/origin/android-5.1.0_r3
remotes/origin/android-5.1.0_r4
remotes/origin/android-5.1.0_r5
remotes/origin/android-5.1.1_r1
remotes/origin/android-5.1.1_r10
remotes/origin/android-5.1.1_r12
remotes/origin/android-5.1.1_r13
remotes/origin/android-5.1.1_r14
remotes/origin/android-5.1.1_r15
remotes/origin/android-5.1.1_r16
remotes/origin/android-5.1.1_r17
remotes/origin/android-5.1.1_r18
remotes/origin/android-5.1.1_r2
remotes/origin/android-5.1.1_r3
remotes/origin/android-5.1.1_r4
remotes/origin/android-5.1.1_r5
remotes/origin/android-5.1.1_r6
remotes/origin/android-5.1.1_r7
remotes/origin/android-5.1.1_r8
remotes/origin/android-5.1.1_r9
remotes/origin/android-cts-2.2_r8
remotes/origin/android-cts-2.3_r10
remotes/origin/android-cts-2.3_r11
remotes/origin/android-cts-2.3_r12
remotes/origin/android-cts-4.0.3_r1
remotes/origin/android-cts-4.0.3_r2
remotes/origin/android-cts-4.0_r1
remotes/origin/android-cts-4.1_r1
remotes/origin/android-cts-4.1_r2
remotes/origin/android-cts-4.1_r4
remotes/origin/android-cts-4.2_r2
remotes/origin/android-cts-4.4_r4
remotes/origin/android-cts-5.0_r2
remotes/origin/android-cts-5.0_r3
remotes/origin/android-cts-5.1_r1
remotes/origin/android-cts-5.1_r2
remotes/origin/android-cts-verifier-4.0.3_r1
remotes/origin/android-cts-verifier-4.0_r1
remotes/origin/android-l-preview_r2
remotes/origin/android-live-tv
remotes/origin/android-m-preview
remotes/origin/android-m-preview-1
remotes/origin/android-m-preview-2
remotes/origin/android-sdk-4.0.3-tools_r1
remotes/origin/android-sdk-4.0.3_r1
remotes/origin/android-sdk-4.4.2_r1
remotes/origin/android-sdk-4.4.2_r1.0.1
remotes/origin/android-sdk-adt_r16.0.1
remotes/origin/android-sdk-adt_r20
remotes/origin/android-sdk-support_r11
remotes/origin/android-support-test
remotes/origin/android-tsl-2.0
remotes/origin/android-tsl-3.0
remotes/origin/android-wear-5.0.0_r1
remotes/origin/android-wear-5.1.0_r1
remotes/origin/android-wear-5.1.1_r1
remotes/origin/chromium-dev
remotes/origin/droiddriver-dev
remotes/origin/emu-1.4-release
remotes/origin/emu-master-dev
remotes/origin/froyo
remotes/origin/gcc
remotes/origin/gingerbread
remotes/origin/gingerbread-release
remotes/origin/gradle-dev
remotes/origin/gradle_0.12.2
remotes/origin/gradle_0.13.0
remotes/origin/gradle_0.13.1
remotes/origin/gradle_0.13.2
remotes/origin/gradle_0.13.3
remotes/origin/gradle_0.14.0
remotes/origin/gradle_0.14.1
remotes/origin/gradle_0.14.2
remotes/origin/gradle_0.14.3
remotes/origin/gradle_0.14.4
remotes/origin/gradle_1.0.0
remotes/origin/gradle_1.0.0-rc1
remotes/origin/gradle_1.0.0-rc2
remotes/origin/gradle_1.0.0-rc3
remotes/origin/gradle_1.0.0-rc4
remotes/origin/gradle_1.0.1
remotes/origin/gradle_1.1.0
remotes/origin/gradle_1.1.0-rc1
remotes/origin/gradle_1.1.0-rc2
remotes/origin/gradle_1.1.0-rc3
remotes/origin/gradle_1.1.1
remotes/origin/gradle_1.1.2
remotes/origin/gradle_1.1.3
remotes/origin/gradle_1.2.0
remotes/origin/gradle_1.2.0-beta1
remotes/origin/gradle_1.2.0-rc1
remotes/origin/gradle_1.2.1
remotes/origin/gradle_1.2.2
remotes/origin/gradle_1.2.3
remotes/origin/gradle_1.3.0-beta1
remotes/origin/gradle_1.3.0-beta2
remotes/origin/gradle_1.3.0-beta3
remotes/origin/gradle_1.3.0-beta4
remotes/origin/gradle_1.3.1
remotes/origin/ics-mr0
remotes/origin/ics-mr1
remotes/origin/ics-plus-aosp
remotes/origin/idea133
remotes/origin/idea133-weekly-release
remotes/origin/jb-dev
remotes/origin/jb-mr1-dev
remotes/origin/jb-mr1-dev-plus-aosp
remotes/origin/jb-mr1.1-cts-dev
remotes/origin/jb-mr1.1-dev
remotes/origin/jb-mr1.1-dev-plus-aosp
remotes/origin/jb-mr2-cts-dev
remotes/origin/jb-mr2-dev
remotes/origin/jumper-stable
remotes/origin/kitkat-cts-dev
remotes/origin/kitkat-dev
remotes/origin/l-preview
remotes/origin/lldb-master-dev
remotes/origin/llvm
remotes/origin/lollipop-cts-dev
remotes/origin/lollipop-dev
remotes/origin/lollipop-mr1-cts-dev
remotes/origin/lollipop-mr1-dev
remotes/origin/master
remotes/origin/master-art
remotes/origin/master-art-host
remotes/origin/master-dalvik
remotes/origin/master-dalvik-host
remotes/origin/master-ndk
remotes/origin/master-soong
remotes/origin/studio-1.0-dev
remotes/origin/studio-1.0-release
remotes/origin/studio-1.1-dev
remotes/origin/studio-1.1-release
remotes/origin/studio-1.2-dev
remotes/origin/studio-1.2-release
remotes/origin/studio-1.3-dev
remotes/origin/studio-1.3-release
remotes/origin/studio-1.4-dev
remotes/origin/studio-1.4-lldb-dev
remotes/origin/studio-1.4-release
remotes/origin/studio-master-dev
remotes/origin/studio-master-release
remotes/origin/studio_0.8.6
remotes/origin/studio_1.0.0
remotes/origin/studio_1.0.1
remotes/origin/tools-canary-release
remotes/origin/tools_ndk_r9d
remotes/origin/tools_r20
remotes/origin/tools_r21
remotes/origin/tools_r21.1
remotes/origin/tools_r22
remotes/origin/tools_r22.2
remotes/origin/tools_r22.6
remotes/origin/tradefed
remotes/origin/ub-emulator-master
remotes/origin/ub-jack
remotes/origin/ub-jack-arzon
remotes/origin/ub-jack-arzon-mr2
remotes/origin/ub-jack-brest
remotes/origin/ub-jack-lang-dev
remotes/origin/ub-tools-idea133
remotes/origin/ub-tools-idea133-milestone
remotes/origin/ub-tools-idea133-release
remotes/origin/ub-tools-master
remotes/origin/ub-webview-m40-release
remotes/origin/upstream-mirror-lldb
remotes/origin/webview-m40_r1
remotes/origin/webview-m40_r2
remotes/origin/webview-m40_r3
remotes/origin/webview-m40_r4

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

安卓系统学习--获取Google安卓系统源码

安卓系统学习--获取Google安卓系统源码

$ repo sync

安卓系统学习--获取Google安卓系统源码

安卓系统学习--获取Google安卓系统源码

使用repo sync同步下载代码时因为网络原因可能会经常断线,可以使用下面的脚本来做个脚本文件,让它中断后,又自动下载


创建脚本download.sh

#!/bin/bash
echo "=========start repo sync=============="
./repo sync
while [ $? == 1 ]; do
echo "======sync failed, re-sync again======"
sleep 3
./repo sync
done


错误笔记:

git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'lhy@Ubuntu.(none)')

解决办法:

安卓系统学习--获取Google安卓系统源码


下载Android源码提示错误:http://www.linuxdiyf.com/linux/14974.html

ubuntu15.04编译android源码:http://www.linuxdiyf.com/linux/14709.html

64位Ubuntu15.04安装Android Studio教程:http://www.linuxdiyf.com/linux/12081.html

Ubuntu 15.04 Android编译环境:http://www.linuxdiyf.com/linux/11971.html

基于Ubuntu 15.04 LTS编译Android5.1.0源代码:http://www.linuxdiyf.com/linux/11841.html