栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

win10最新下载编译Android源码的简易方法分享(已亲测)

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

win10最新下载编译Android源码的简易方法分享(已亲测)

win10最新下载编译Android源码的简易方法分享(已亲测)
  1. 准备至少150G的硬盘空间
  2. win+R 输入control 打开程序与功能-启用或关闭Windows功能
  3. 勾选“适用于Linux的Windwos子系统”
  4. 重启电脑
  5. win 点击设置-开发者选项-勾选“开发人员模式”
  6. https://docs.microsoft.com/en-us/windows/wsl/install-manual
  7. 找到Downloading distributions —下载Ubuntu 20.04
  8. 打开windows powershell 输入netsh winsock reset
  9. win+R 输入services.msc 启动Windows installer、Windows Update、Cryptographic Services 、 Background Intelligent Transfer Service、LxxManager
  10. 将下载好的Ubuntu.aapx放入除C盘外的其他盘—解压—双击ubuntu.exe
  11. (ubuntu的文件目录就是rootfs) (home就是初始目录)
  12. 等待unbutu安装,大概15分钟,根据提示,输入名字与密码
  13. 下面就是配置下载编译Android源码的语法

新建一个bin文件夹

mkdir ~/bin

添加到环境变量中

PATH=~/bin:$PATH

增加文件夹访问权限

chmod 777 ~/bin

安装curl

sudo apt install curl

下载repo(一个用来管理aosp的py脚本)

curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o ~/bin/repo

增加文件的执行权限,repo是一个文件,不是文件夹

chmod a+x ~/bin/repo

打开repo这个文件,文件头改为

/usr/bin/env python3

打开bashrc文件,可以直接找到打开,也可以用gedit编辑器打开

gedit ~/.bashrc

往里面末尾添加一行内容

export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'

让bashrc生效

source ~/.bashrc

安装git

sudo apt install git

配置git

git config --global user.name yourname
git config --global user.email youremail@qq.com
git config --global http.sslverify false
git config --global https.sslverify false
git config --global --list #查看是否配置成功

下载android源码,先创建一个存放android的文件夹,进去,下载对应版本的android源码(我这里下的是android10,用的12个线程下载,下载时间大概30分钟,会卡在99%那里,不要急,等10分钟左右就行,然后会一直updating files:…,大概20分钟)

mkdir -p aosp/android
cd aosp/android
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-10.0.0_r1
repo sync -j12

安装依赖包

sudo apt-get install git-core gnupg fiex bison build-essential zip curl zlibig-dev  gcc-multilib g++-multilib libc6-dev-i386 libncurses5 lib32ncurses5-dev xl1proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig

android源码就下载到aos/android文件夹中,可以选择编译整个源码,或者另作它用

编译源码

source build/envsetup.sh
lunch
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/941639.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号