一、获得源码
在网上找了很久,看到的资料都是一样的,都是以Ubuntu为版本的一个参考。
http://source.android.com/source/downloading.html网站体提示很 完 整
注意:在repo整个android源码时有可能会出错,如下:
repo init -u https://android.googlesource.com/platform/manifest
Traceback (most recent call last):
File "/home/chao/.repo/repo/main.py", line 235, in <module>
_Main(sys.argv[1:])
File "/home/
chao/.repo/repo/main.py", line 217, in _Main
repo._Run(argv)
File "/home/
chao/.repo/repo/main.py", line 123, in _Run
cmd.Execute(copts, cargs)
File "/home/
chao/.repo/repo/subcmds/init.py", line 219, in Execute
self._SyncManifest(opt)
File "/home/
chao/.repo/repo/subcmds/init.py", line 110, in _SyncManifest
m.PreSync()
File "/home/
chao/.repo/repo/project.py", line 1456, in PreSync
cb = self.CurrentBranch
File "/home/
chao/.repo/repo/project.py", line 271, in CurrentBranch
b = self.work_git.GetHead()
File "/home/
chao/.repo/repo/project.py", line 1242, in GetHead
fd = open(path, 'rb')
IOError: [Errno 2] No such file or directory: '/home/
chao/.repo/manifests/.git/HEAD'
这个可能有三个原因,
(1):没有安装git,只是安装了repo
(2):可能由于先用git下载了,而后又用repo来下载
(3):应该是之前旧的repo sync导致的,
直接书入git 会 提示,复制即可