如您所知,有数百个项目的清单https://android.googlesource.com/ https://android.googlesource.com/。我想将它们全部下载到 Windows 机器中。根据谷歌的文件,
To install, initialize, and configure Repo:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
To clone the entire platform, install repo, and run:
mkdir mydroid
cd mydroid
repo init -u https://android.googlesource.com/platform/manifest
repo sync
然而,在我的机器上,我无法在 Git Bash 中“repo init”,因为它说它没有 python。我安装了 python,但 git bash 无法识别它。请注意,我也将 python 目录设置为系统路径。如果有人可以提供提示,我将不胜感激。谢谢
更新:我相信这是 Windows 版 Git Bash 新版本的问题。系统路径根本不适用于 Git Bash - 我可以轻松测试系统路径是否与命令提示符一起使用。不管怎样,我尝试了这个,当然它实际上运行时出错了。
/c/python27/python.exe ../bin/repo init -u https://android.googlesource.com/platform/manifest
错误信息是
$ /c/python27/python.exe ../bin/repo init -u https://android.googlesource.com/platform/manifest
Traceback (most recent call last):
File "../bin/repo", line 91, in <module>
import readline
ImportError: No module named readline
好的。我通过在 Windows 中安装 pyreadline 解决了这个错误:
easy_install pyreadline
如果出现错误,则必须从以下位置安装 setuptools
http://pypi.python.org/pypi/setuptools#files
最后再次运行命令得到这个:
$ repo init -u https://android.googlesource.com/platform/manifest
fatal: unable to start d:\mywork\dev\GoogleAndroid\working_dir\.repo\repo/main.py
fatal: [Errno 8] Exec format error