ITPub博客

首页 > 应用开发 > IT综合 > 下载android的源码

下载android的源码

原创 IT综合 作者:zpf 时间:2011-12-30 09:52:26 0 删除 编辑

安装环境是linux平台

1’ http://source.android.com学习一下

1,安装git,(1.7)

2,安装python(2.7),python3不行。

3,获取android的repo脚本(需要安装curl)

......

以下为正文

[@more@]安装环境是linux平台

1’ http://source.android.com学习一下

1,安装git,(1.7)

2,安装python(2.7),python3不行。

3,获取android的repo脚本(需要安装curl)

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
4,将repo加上可执行权限。将repo放到path环境变量中。

5,测试一下repo是否可以执行

正常应该出现:

repo
error: repo is not installed. Use "repo init" to install it here.

或者:

usage: repo COMMAND [ARGS]

The most commonly used repo commands are:

abandon Permanently abandon a development branch
branch View current topic branches
branches View current topic branches
checkout Checkout a branch for development
cherry-pick Cherry-pick a change.
diff Show changes between commit and working tree
download Download and checkout a change
grep Print lines matching a pattern
init Initialize repo in the current directory
list List projects and their associated directories
prune Prune (delete) already merged topics
rebase Rebase local branches on upstream branch
smartsync Update working tree to the latest known good revision
stage Stage file(s) for commit
start Start a new branch for development
status Show the working tree status
sync Update working tree to the latest revision
upload Upload changes for code review

See 'repo help ' for more information on a specific command.

可能出现的情况是:

a:

See File "./repo", line 180
except OSError, e:
^
SyntaxError: invalid syntax
'repo help --all' for a complete list of recognized commands.

这是因为你安装的python是2.5以下,或者2.7以上,你换成python2.7

b:

Traceback (most recent call last):
File "./repo", line 91, in
import readline
ImportError: No module named readline

这是因为你安装的python没有readline模块,需安装一下。

1):需要下载readline-6.2.1.tar.gz

2):安装readline-6.2.1时,需要执行python setup.py build

python setup.py install

3:)这时可能需要你安装setuptools

下载 setuptools-0.6c9-py2.7.egg,执行

sh setuptools-0.6c9-py2.7.egg

如果提示你/usr/bin/ld: cannot find -lxxxx,你去查询一下系统是否安装了xxxx ,包括 xxxx-dev

4:)安装完readline,repo应改能正常使用了。

python的资源,可能因为GFW的原因,不能正常访问。通过翻墙获取。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/8557/viewspace-1056991/,如需转载,请注明出处,否则将追究法律责任。

下一篇: Rexsee 入门学习
请登录后发表评论 登录
全部评论

注册时间:2011-06-21

  • 博文量
    11
  • 访问量
    117243