首先得下载一个GIT在windows可以用PortableGit。有了git只能手动的输入要下载android源码的某部分,不过可以从以下地址http://android.git.kernel.org/?a=project_index 得到所有可以下载的源码。由于这个列表并不能直接用在PortableGit命令中所以我写了一个VBS脚本来转换
szFolder ="K:\Hemowolf\SRC_Android"'存放android源码目录
Set Fso = CreateObject("Scripting.FileSystemObject")
Set inFile =Fso.OpenTextFile("1.txt")'get TXT 文件
Set outFile =Fso.CreateTextFile("android.sh")'输出文件用于执行的
Do While Not ( inFile.AtEndOfLine Or inFile.AtEndOfStream)
szLine =inFile.ReadLine()
If (szLine <>"") Then
szLine = Trim(Replace(szLine,"Android+Open+Source+Project",""))
Item = Split(szLine, "/")
szPath =szFolder
For i = 0 To UBound(Item)
szPath = szPath & "\" & Item(i)
If Not Fso.FolderExists(szPath) Then Call Fso.CreateFolder(szPath)
Next
outFile.WriteLine "git clone git://android.git.kernel.org/" & szLine & " " & Replace(szPath,"\","/")
End if
Loop
inFile.Close
outFile.Close
MsgBox "ok"
脚本会自动在android存放源码的目录里创建相应的子目录。转换后把android.sh放到PortableGit目录下或PortableGit定位(cd)到android.sh目录下输入android.sh就可以下载了!