下载联系人应用程序的 Android 代码
我正在尝试从 git 存储库下载联系人、拨号器和通话记录应用程序的 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 dir
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库。不幸的是,我不知道这是否是真正的问题,如果是,如何安装它。
I am trying to download Android source code for Contact,Dialer and CallLog applications from the git repository. I have tried the following on my mac(running SnowLeopard):
1. Create a bin dir and a android dir for putting all the downloaded files
2. Added both of the directories to the PATH environment variable
3. run the following commands to get the repo script and make it executable:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
4. cd android dir
5. run repo init -u https://android.googlesource.com/platform/manifest -b froyo
When I run this command, I am getting the following errors:
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
A quick google search tells that I need to install git-core library. Unfortunately, I don't know if that is the real problem or not and if so, how to install it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能想为 OS X 安装 git。您可以在这里找到一个方便的安装程序:http ://code.google.com/p/git-osx-installer/
只要 git 目录出现在你的 $PATH 中(我不记得安装程序是否这样做,或者你需要这样做手动),该 python 脚本在执行时应该找到它。或者,您可以破解 python 脚本,以便它确切地知道 git 在哪里。
You probably want to install git for OS X. You can find a handy installer here: http://code.google.com/p/git-osx-installer/
As long as the git directory appears in your $PATH (I can't remember if the installer does this or you'd need to do it manually), that python script should find it when it's executed. Alternatively, you could hack the python script so that it knows exactly where git is.
如果你看一下
https://android.googlesource.com/platform/packages/apps/Contacts,您将看到基本的 git 命令就是:
这样您就可以将联系人存储库克隆到当前目录中。是的,你需要为此安装 git。如果您只想处理平台的各个部分并且不想检查所有内容,那么您可以仅使用 git,而根本不必使用
repo
工具。If you take a look at
https://android.googlesource.com/platform/packages/apps/Contacts, you will see that the basic git command is just:
that way you clone the Contacts repository into your current directory. And yes, you need to have git installed for this. If you just want to work on individual parts of the platform and don't want to check out everything then you can work with just git and you don't have to use the
repo
tool at all.