我正在尝试从 git 存储库下载 Contact、Dialer 和 CallLog 应用程序的 Android 源代码。我在我的 mac(运行 SnowLeopard)上尝试了以下操作:
1. 创建一个 bin 目录和一个 android 目录来放置所有下载的文件
2. 将两个目录都添加到 PATH 环境变量
3. 运行以下命令以获取repo 脚本并使其可执行:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
4. cd android 目录
5. 运行repo init -u https://android.googlesource.com/platform/manifest -b froyo
当我运行此命令时,我收到以下错误:
Traceback (most recent call last):
File "/Users/xxxx/bin/repo", line 595, in <module>
main(sys.argv[1:])
File "/Users/xxxx/bin/repo", line 562, in main
_Init(args)
File "/Users/xxxx/bin/repo", line 181, in _Init
_CheckGitVersion()
File "/Users/xxxx/bin/repo", line 210, in _CheckGitVersion
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 593, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/subprocess.py", line 1079, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
一个快速的谷歌搜索告诉我需要安装 git-core 库。不幸的是,我不知道这是否是真正的问题,如果是,如何安装它。