windows下载Android源码

2021/10/13 7:14:10

本文主要是介绍windows下载Android源码,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1.查看最新源码分支

git clone https://aosp.tuna.tsinghua.edu.cn/platform/manifest
cd .\manifest\
git tag
git checkout android-12.0.0_r2

2.克隆所有仓库

python sync.py

import xml.dom.minidom
import os
from subprocess import call
 
# 保存源码路径
rootdir = "C:/Users/wdp/Desktop/source/android-12.0.0_r2"
 
# git路径
git = "C:/Program Files/Git/bin/git.exe"
 
dom = xml.dom.minidom.parse("C:/Users/wdp/Desktop/source/manifest/default.xml")
root = dom.documentElement
 
prefix = git + " clone https://aosp.tuna.tsinghua.edu.cn/"
suffix = ".git"
 
if not os.path.exists(rootdir):
    os.mkdir(rootdir)
 
for node in root.getElementsByTagName("project"):
    os.chdir(rootdir)
    d = node.getAttribute("path")
    last = d.rfind("/")
    if last != -1:
        d = rootdir + "/" + d[:last]
        if not os.path.exists(d):
            os.makedirs(d)
        os.chdir(d)
    cmd = prefix + node.getAttribute("name") + suffix
    call(cmd)


这篇关于windows下载Android源码的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程