继上一篇博客介绍了VMware Workstation15 配置ubuntu-18.04.4,这篇主要介绍安装后环境搭建,Android源码的下载与编译。小编当前下载的是当前最新的代码,是主干分支代码,20200301.tar,后又同步,查看系统版本是R系统、即Android 11(获取 Android 11)。解释 aosp(Android Open Source Project)。

windows查看ubuntu中的android源码 samba 共享ubuntu系统文件夹到Windows
或 FileZilla连接VMWare实现ubuntu与windows互传文件
为了便于网友针对性查看阅读,调整这篇文档结构,前半部分只写下载android aosp源码用到的,其他遇到的问题还有ubuntu配置相关的放到文档后半部分,由于不同的时间不同的环境配置不太一样,可能遇到的问题解决方式也不一样,建议网友阅读的时候,如果按照这里的介绍没有成功,多在网上搜索搜索或分析解决问题 2021.12.4 14:10 sh ylxy 50210
同步完代码后,~/bin/aosp/ cat build/core/version_default.xml可以看源码的版本信息

设置root用户密码

Ubuntu安装好后,root初始密码(默认密码)是不知道的,也没有进行设置,这里需要设置一下密码才可以使用root用户登录
sudo passwd root
123 密码尽量设置容易记得

安装 软件

sudo apt-get install vim
sudo apt install curl

设置 vi 显示行号

cd  /etc/vim
sudo vim  vimrc
set nu #在vimrc文件最后面加入下面内容就行

安装配置git

sudo apt-get install git
git config --global user.email "xxx@163.com"
git config --global user.name "xxx"

如果报错:fatal: not in a git directory
则先执行

git init

再执行

git config –global user.email "xxx@163.com"

fatal: not in a git directory

一、Android系统源码 下载

1、迅雷下载aosp-latest.tar

从 https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/ 下载当前最新的aosp jar包,也就是 aosp-20210701.tar,现在最新的就是20210701.tar 这个tar包,所以它和 aosp-latest.tar是同一个压缩包,从迅雷下载这个jar包(126G),迅雷会使用云下载,真的超级快

下载完后,windows文件共享到ubuntu中,1右键按照下图开启共享

2、配置PATH环境变量

添加~/bin 到环境变量PATH里面
从android的源码下载网站可以看到,是repo是建议我们在home下配置一个bin目录的,然后把bin目录path添加在配置文件中,笔者用的是虚拟机上的ubuntu,又想原本的操作系统可以看到下载好的源码,所以我是做了一个共享文件夹android,然后在共享文件夹中创建的bin目录,再把bin目录软连到home下。最后还是没有使用共享文件夹,担心不同的文件系统,会影响文件
具体命令如下:

cd ~
mkdir ~/bin  # 1 。要么执行2语句,要么执行这条语句
# ln -s /mnt/hgfs/android/bin/ ~   # 2
echo "PATH=~/bin:\$PATH" >> ~/.bashrc
source ~/.bashrc

此处创建软链接的效果等同于 主目录下有一个 bin/ 目录,并且该目录包含在PATH中
软连建立:ln -s 源文件 软链接文件
android是ubuntu共享windows下的文件夹,ln是创建了一个软链接

将下载好的aosp-latest.tar copy到bin目录下

cp /mnt/hgfs/xunlei/aosp-latest.tar ./bin/


如果你在ubuntu里面使用
wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar下载也快的话,你可以使用这种方式下载,就省了windows往ubuntu copy的过程

3、解压tar包,下载repo文件,repo sync

下载 repo 工具,修改它可执行

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
## 或者使用 curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod a+x ~/bin/repo

解压aosp-20200301.tar

cd ~/bin/
#wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-20200301.tar  不要下载aosp-latest.tar的,最好下载离aosp-latest.tar最近打包的,因为aosp-latest.tar一直在更新,你下载过程中服务器一旦更新,下载的信息可能发生错误,导致下载进度归零
##wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 下载初始化包
tar xvf aosp-latest.tar # 解压得到的 aosp 工程目录
cd aosp
## repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-12.0.0_r15 //你可以使用此命令下载android12分支的代码,默认repo sync同步下来的是master分支的代码
repo sync # 正常同步一遍即可得到完整目录

查看分支信息,指定分支后(如下命令) 同步

xxx:~/bin/aosp$cd .repo/manifests
xxx:~/bin/aosp/.repo/manifests$ git branch -a
xxx:~/bin/aosp/.repo/manifests$ git branch -a | grep "android-12"
xxx:~/bin/aosp$ repo init -u https://android.googlesource.com/platform/manifest -b android-13.0.0_r9
xxx:~/bin/aosp$ repo init -u https://android.googlesource.com/platform/manifest
xxx:~/bin/aosp$ repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-13.0.0_r9

如果init的时候未指定分支名称,在代码下载完成后,可以通过命令repo start android-13.0.0_r9 --all 切换分支
repo forall -c“ git checkout android_4.2.2_r1”这会将所有git存储库切换到所需的分支.
更新于2022年10月30日 11:28 sh ylxy 50288168


Repo下载AOSP源码:基于ubuntu22.04 环境配置
Android AOSP 下载和编译
[aosp][Android] 如何查看当前分支

4、repo sync

过程中如果遇到类似的问题
info: A new version of repo is available
warning: repo is not tracking a remote branch, so it will not receive updates
repo reset: error: Entry ‘SUBMITTING_PATCHES.md’ not uptodate. Cannot merge.
fatal: Could not reset index file to revision ‘v2.18^0’.
参考Android系统源码AOSP repo sync报错:info: A new version of repo is available
2020-12-09 Android源码里面查看版本号的方法
如下时间 2021.12.11 11:17

二、编译

安装jdk
sudo apt-get install openjdk-11-jdk
javac -version//查看安装是否成功

//不知道哪些有用,哪些没用,网上都是这么写的,索性都安装了
sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev
sudo apt-get install git-core gnupg flex bison gperf build-essential
sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
sudo apt-get install libc6-dev-i386
sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
sudo apt-get install lib32z-dev ccache
sudo apt-get install libssl-dev

小编在安装输入第一条命令的时候,ubuntu提示libreadline6-dev:i386 建议安装libreadline-dev:i386,于是又安装了一次libreadline-dev:i386

source build/envsetup.sh
make clobber //如果你之前编译过,使用此命令进行清除操作,以避免之前进行的build干扰到接下来的build
//选择编译开发工程师的版本,方便debug
lunch aosp_x86_64-eng //如果你想编译aosp_x86_64-eng,可以直接这样写。你也可以只输入  lunch,然后下面再选版本,选版本时输入版本序号即可
make -j4

lunch命令查看可以编译的镜像类型

输入上面列出的镜像类型对应的序号,编译你需要的

You're building on LinuxLunch menu... pick a combo:1. aosp_arm-eng2. aosp_arm64-eng3. aosp_barbet-userdebug4. aosp_blueline-userdebug5. aosp_blueline_car-userdebug6. aosp_bonito-userdebug7. aosp_bonito_car-userdebug8. aosp_bramble-userdebug9. aosp_bramble_car-userdebug10. aosp_car_arm-userdebug11. aosp_car_arm64-userdebug12. aosp_car_x86-userdebug13. aosp_car_x86_64-userdebug14. aosp_cf_arm64_auto-userdebug15. aosp_cf_arm64_phone-userdebug16. aosp_cf_x86_64_foldable-userdebug17. aosp_cf_x86_64_pc-userdebug18. aosp_cf_x86_64_phone-userdebug19. aosp_cf_x86_64_tv-userdebug20. aosp_cf_x86_auto-userdebug21. aosp_cf_x86_phone-userdebug22. aosp_cf_x86_tv-userdebug23. aosp_coral-userdebug24. aosp_coral_car-userdebug25. aosp_crosshatch-userdebug26. aosp_crosshatch_car-userdebug27. aosp_crosshatch_vf-userdebug28. aosp_flame-userdebug29. aosp_flame_car-userdebug30. aosp_redfin-userdebug31. aosp_redfin_car-userdebug32. aosp_redfin_vf-userdebug33. aosp_sargo-userdebug34. aosp_sargo_car-userdebug35. aosp_slider-userdebug36. aosp_sunfish-userdebug37. aosp_sunfish_car-userdebug38. aosp_trout_arm64-userdebug39. aosp_trout_x86-userdebug40. aosp_whitefin-userdebug41. aosp_x86-eng42. aosp_x86_64-eng43. arm_krait-eng44. arm_v7_v8-eng45. armv8-eng46. armv8_cortex_a55-eng47. armv8_kryo385-eng48. beagle_x15-userdebug49. beagle_x15_auto-userdebug50. car_x86_64-userdebug51. db845c-userdebug52. fuchsia_arm64-eng53. fuchsia_x86_64-eng54. gsi_car_arm64-userdebug55. gsi_car_x86_64-userdebug56. hikey-userdebug57. hikey64_only-userdebug58. hikey960-userdebug59. hikey960_tv-userdebug60. hikey_tv-userdebug61. pixel3_mainline-userdebug62. poplar-eng63. poplar-user64. poplar-userdebug65. qemu_trusty_arm64-userdebug66. sdk_car_arm-userdebug67. sdk_car_arm64-userdebug68. sdk_car_x86-userdebug69. sdk_car_x86_64-userdebug70. silvermont-eng71. uml-userdebug72. yukawa-userdebug73. yukawa_sei510-userdebugWhich would you like? [aosp_arm-eng]

要求电脑(虚拟机)可用的内存为16G,不然会很容易失败



失败,报错

[100% 250/250] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/soong/.bootstrap/bin/soong_build")" && BUILDER="$PWD/$(basen
ame "out/soong/.bootstrap/bin/soong_build")" && cd / && env -i "$BUILDER"     -
-top "$TOP"     --out "out/soong"     -n "out"     -d "out/soong/build.ninja.d"-t -l out/.module_paths/Android.bp.list -globFile out/soong/.bootstrap/bui
ld-globs.ninja -o out/soong/build.ninja --available_env out/soong/soong.environ
ment.available --used_env out/soong/soong.environment.used Android.bp
Killed
13:38:51 soong bootstrap failed with: exit status 1
FAILED: ninja fifo didn't finish after 5s
ninja: build stopped: subcommand failed.#### failed to build some targets (53:53 (mm:ss)) ####============================================
[100% 1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/soong/.bootstrap/bin/soong_build")" && BUILDER="$PWD/$(basename "out/soong/.bo
otstrap/bin/soong_build")" && cd / && env -i "$BUILDER"     --top "$TOP"     --out "out/soong"   -n "out"     -d "out/soong/build.ninja.d"     -t -l out/.module_paths/Android.bp.list -globFileout/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja --available_env out/soong/soong.
environment.available --used_env out/soong/soong.environment.used Android.bp
Killed
16:21:28 soong bootstrap failed with: exit status 1
ninja: build stopped: subcommand failed.#### failed to build some targets (01:26:03 (hh:mm:ss)) ####

如果报以上错误,就说明是内存不够。可以增加页交换大小(方式见下面截图),来尝试解决(并不一定能解决,小编之前用的ubuntu18,后来有改用ubuntu20.04下载的,尝试修改了7、8次吧,每次编译12个小时以上,后面总是卡住不动了,直接卡死,不清楚是不是哪修改的不对,没成功,准备再换成ubuntu18编译试试)。页交换,即使用物理存储当内存用
注意:虚拟机重新开机后,新增加的页交换会失效

free -m //查看内存情况
//创建交换分区的文件:增加16G大小的交换分区,则命令写法如下,其中的 count 等于想要的块大小
dd if=/dev/zero of=/home/swapfile bs=1M count=16384
//设置交换分区文件,建立swap的文件系统
mkswap /home/swapfile
//立即启用交换分区文件
swapon /home/swapfile



每次编译一夜,或者长时间后就会各种卡死,还没成功

2021.12.11 11:51 sh ylxy yyds 5210
参考:vmware和ubuntu编译运行aosp

下面部分的内容是小编20年到今天(2021.12.04 14:52)下载代码的一些过程(并不是下了两年,是有时候会更新,或者从新搞),遇到的问题及解决方法,如果有需要的,可以继续看下面部分的内容。

切换到root用户执行

su root
在ubuntu系统中总提示Permission denied
小编又更新了ubuntu版本,现在用的是ubuntu20.04 安装后,直接可以从windows到ubuntu复制黏贴
windows系统与Ubuntu虚拟机之间实现文件的相互复制粘贴

sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools-desktop

成功后最好重启ubuntu
参考:
Windows和Ubuntu系统之间文件相互复制粘贴
【Tools】Ubuntu20.04安装VMware Tools详解
ubuntu vi 上下左右变ABCD问题解决方法
只要依次执行以下两个命令即可完美解决ubuntu下vi编辑器方向键变字母的问题。

sudo apt-get remove vim-common
sudo apt-get install vim

参考:Ubuntu vi 上下左右变ABCD问题解决方法
Ubuntu:vim键盘上下左右按键变ABCD

Linux下使用、设置Tab键,以及设置vim,让它显示行号
备份软件源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

软件源版本问题

切记:不同的ubuntu版本有不同的源,查看ubuntu版本:lsb_release -a

lsb_release -a

ubuntu20.04 LTS 更换国内163源、阿里源、清华源、中科大源
Ubuntu 镜像使用帮助

快速查找Ubuntu各版本国内源及更新

更新源

sudo vi /etc/apt/sources.list
#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

Ubuntu更新软件源
1.使用软件更新, 终端输入命令:

sudo apt update

完成之后继续输入命令:

sudo apt upgrade

Ubuntu18.04.3虚拟机安装步骤(图文教程,非常详细!!!)
Ubuntu更换软件源
2020年3月10日 22:33 yuxingjy 68827102

自己动手编译Android源码(超详细)
Ubuntu 18.04 配置android 源码开发/编译环境

安装 repo

sudo apt install repo

安装依赖库

sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev
sudo apt-get install git-core gnupg flex bison gperf build-essential
sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
sudo apt-get install libc6-dev-i386
sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
sudo apt-get install lib32z-dev ccache
sudo apt-get install libssl-dev

如果报错 ,有可能当时服务器网络不稳定,过一会重新执行
unable to locate package libesd0-dev

sudo vim /etc/apt/sources.list  //在行尾添加如下两行的内容
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse

更新软件源并重新安装:

sudo apt-get update && sudo apt-get install libesd0-dev

ubuntu18.04无法安装libesd0-dev完美解决办法
下载 Repo 工具,并确保它可执行

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
## 或者使用 curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod a+x ~/bin/repo

下载代码

mkdir bin
cd bin

wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-20200301.tar  不要下载aosp-latest.tar的,最好下载离aosp-latest.tar最近打包的,因为aosp-latest.tar一直在更新,你下载过程中服务器一旦更新,下载的信息可能发生错误,导致下载进度归零
##wget -c https://mirrors.tuna.tsinghua.edu.cn/aosp-monthly/aosp-latest.tar # 下载初始化包
tar xvf aosp-latest.tar # 解压得到的 AOSP 工程目录//如果提示没权限,可以使用 sudo  tar xvf  xxx
cd AOSP
repo sync # 正常同步一遍即可得到完整目录
# ../repo sync  小编后来使用的这个命令,意思是使用自己下载的repo命令,即bin/repo,当前所在的目录是aosp目录,所以用../repo sync

小编用ubuntu下载,一直没下载成功,从这周二就开始倒腾这个,时不时的和服务器就断了,不知为何,此时下载的是aosp-latest.tar。用迅雷也在下载,好在迅雷下载的稳定些

已经下了3天了。后来突然归零了。又从新下载了20190801号的tar包。
执行repo sync之后,我的ubuntu 提示了一句

warning: redirecting to https://aosp.tuna.tsinghua.edu.cn/platform/manifest/

然后一直不动,从昨天到现在有20个小时了,我一怒之下 安装ctrl + c,提示
aborted by user

Android 8.1.0 AOSP源码下载及编译
Another infinity
Android 9、10 -源码下载编译
Android源码 半小时下完Android系统源码
下载源代码
Android源代码下载与编译 - 2019
2020年3月11日 20:48 yuxinjy

Android 镜像使用帮助
Git Repo 镜像使用帮助
AOSP(Android) 镜像使用帮助
Index of /aosp-monthly/
代号、标记和细分版本号
Android 系统源码——下载到编译
自己动手编译Android源码(超详细)

很是倒腾,快弄一个周了,镜像下载也是特别慢,而且总是中断,不支持断点续传。镜像比较大

给root用户设置密码:

sudo passwd root

输入密码,并确认密码
切换到root用户进行操作

su root

2020年3月13日 13:27 yuxinjy sh

很遗憾,源码编译问题还没搞定,准确的来说是进行到了源码同步阶段
即repo sync,我下载的是20190801日的tar包,同步的时候老是出错,应该是网络问题吧,正在下载20200301日的tar包,因为下载aosp-latest.tar下载了两次,第一次到70%,归零了,第二次10% 又归零了,搞了10天了有,很头疼,继续吧
2020年3月18日 18:29 yuxingjiayuan sh
看看repo sync期间的错误








小编在同步过程中,时不时的就会卡着不动,也不知道是没反应了,还是一直在后台运行,只是界面没有更新。于是小编时不时的要 ctrl + c 一下,然后重新执行 …/repo sync命令,有时半夜也要起来看一下,看迅雷下载是不是还在继续,同步是不是还在执行。好在今天起来看到了 repo successfully的字样,从搭建虚拟机环境到现在前前后后已经快2周了,下载代码才基本搞定。为了避免同步过程中有丢失的文件,所以小编在提示repo successfully后又多同步了几次,还在同步。网上很多博客说的同步这一块很简单,不清楚他们是怎么做到的,小编在虚拟机上所有的操作,都在这个博客里进行了记录。希望对大家有所帮助,在你怀疑网络问题的时候(有墙),只能能做一步是一步吧,坚持,如果实在不行,也没办法。
2020年3月21日 7:31 yuxingjiay sh

编译

首先cd到应的源码目路,初始化编译环境。小编的目录是 aosp

source build/envsetup.sh

初始化编译环境后,引入了一些执行脚本,其中就包括马上要使用的lunch指令。通过lunch指令可以设置编译目标,所谓的编译目标就是生成的镜像要运行在什么样的设备上。这里我们设置的编译目标是aosp_arm64-eng,因此执行指令

lunch aosp_arm-eng


aosp表示Android Open Source Project,arm64表示是使用arm64 cpu的设备,eng表示engineer版本,其直接开放了一些root等权限。当然直接使用lunch命令会列出所有可选的编译目标。
我们可通过如下命令来开始编译andriod源码

make -j4

这里的j4表示可以开启4个线程来参与编译源码,这里指定的线程数一般应该遵从cpu内核数的2倍这个规律,可以通过cat /proc/cpuinfo查看相关cpu信息。
Ubantu18.04环境下编译android源码
2020年3月23日11:12 ylxy sq
编译出错

============================================
[100% 55/55] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build-globs.ninja -o out/soong/build.ninja Android.bp
Killed
16:40:26 soong bootstrap failed with: exit status 1
FAILED: ninja fifo didn't finish after 5s
ninja: build stopped: subcommand failed.


由于没有具体报错信息,于是就网上搜索乱试一通

export LC_ALL=C

Ubuntu18.04编译Android源码报[run_soong_ui] Error 1错误
可以将export LC_ALL=C添加到~/.bashrc文件。LC_ALL=C 是为了去除所有本地化的设置,让命令能正确执行。
Ubuntu18.04下编译Android源码笔记

vim /etc/security/limits.conf 添加如下的行

# 解除服务器所有用户文件数 进程限制
*             soft       nofile      10240
*             hard       nofile      10240
*             soft       noproc      10240
*             hard       noproc      10240

保存后,再输入ulimit -n 10240回车即可生效。

sudo sh -c "ulimit -n 65535 && exec su $LOGNAME"

编译错误-build stopped: subcommand failed. 解决方法
Android soong build系统介绍

上面命令执行后有一些用处,之前编译了不到一个小时就报错了,现在编译到1个多小时后报错。最好看官方编译文档,但是没找到
准备换成 lunch aosp_arm64-eng 试试

Ubuntu 18.04(虚拟机)环境下编译Android 源码
Android 系统源码——下载到编译
自己动手编译Android源码(超详细)
2020年3月24日 21:26 ylxysq sh
由于没有官方文档做参考,同时网上也没有找到Android R系统源码的编译相关资料,也不清楚是不是代码没有同步完整的问题引起的,一直没编译成功,很耗费时间,故边搁置边编译。在同步代码的时候,这个platform,你把它当成即当前的aosp目录即可,platform后面的目录即是你aosp下的同步到本地的文件夹

2020年3月26日 10:21 yyjy

aosp repo reset: error: Entry ‘command.py’ not uptodate. Cannot merge.

fatal: Could not reset index file to revision ‘v2.17.3^0’.

下载之后按照官网https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/说的 repo同步方法

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

报错

aosp repo reset: error: Entry 'command.py' not uptodate. Cannot merge.
fatal: Could not reset index file to revision 'v2.17.3^0'.

网上没找到此问题的解决方案,找个类似的没有解决问题
一手下载6月1号的aosp jar包,一手查看代码,结果发现
.repo/repo路径下有 repo文件,

使用此文件同步
bin/aosp路径下
./.repo/repo/repo sync
同步成功

2021.11.23 19:18 还未吃饭 ylxy sh

如何平时自己使用,可以直接修改账户管理员权限
Ubuntu创建用户及用户配置为管理员
sudo vi /etc/sudoers
wrr ALL=(ALL:ALL) ALL //用户名后面的空格是tab键
wq! 强制保存

ubuntu20.04执行的时候,解压aosp-latest.jar时老是报权限问题,原来原因是bin文件夹是在root账户创建的,而解压操作是在wrr账户执行的,重新在wrr账户创建bin文件夹即可

/usr/bin/env: ‘python’: No such file or directory

sudo ln -s /usr/bin/python3 /usr/bin/python
解决:/usr/bin/env: ‘python’: No such file or directory

如果出现此错误
info: A new version of repo is available
warning: repo is not tracking a remote branch, so it will not receive updates
repo reset: error: Entry ‘SUBMITTING_PATCHES.md’ not uptodate. Cannot merge.
fatal: Could not reset index file to revision ‘v2.18^0’.
参考Android系统源码AOSP repo sync报错:info: A new version of repo is available 解决

继续重新同步
2021.12.02 19:25

ubuntu 无法联网

打开终端窗口,在终端窗口输入如下命令:

sudo service network-manager stop
#cp /var/lib/NetworkManager/NetworkManager.state  /var/lib/NetworkManager/NetworkManager.state.bak
sudo rm /var/lib/NetworkManager/NetworkManager.state  //注意先备份
sudo service network-manager start

重新打开 Firefox浏览器,即可联网
Ubuntu 20.04.1 无法联网

Ubuntu 20.04桌面很卡的解决方案–亲测有效

将ubuntu中的文件copy到共享目录报错问题

cp: error writing '/mnt/hgfs/xunlei/frameworks.tar': Input/output error

sudo apt upgrade
sudo apt install open-vm-tools-desktop -y
sudo reboot

2021.12.04 15:03

ubuntu开机密码卡死,或者命令终端界面卡死

sudo dpkg --get-selections | grep linux  //查看安装的linux内核
sudo apt remove linux-image-5.11.0-27-generic  //卸载多余的内核

ubuntu开机输入密码卡死或者无法进入命令行的解决方法
20211211 xx:xx

Windows 环境下载 Android 源码
windows环境android源码下载
20220320 16:55

ubuntu-18.04.4 Android系统源码TP1A(Android 13)下载及编译相关推荐

  1. android系统源码7.1.2_r8下载,编译,运行到nexus5X上,修改源码并编译SDK进行测试

    一,学习android系统源码下载,编译的作用 1,可以自己 DIY 自己的rom系统,从系统层面,宏观的加深理解 android系统 2,编译自己的 userdebug(原生root权限) rom, ...

  2. (连载)Android系统源码分析--Android系统启动流程之Linux内核

    > **这是一个连载的博文系列,我将持续为大家提供尽可能透彻的Android源码分析 [github连载地址](https://github.com/foxleezh/AOSP/issues/3 ...

  3. Android系统源码导入Android studio

    1,下载Android源码 网上很多文章,多半都是在清华或者某个大学的镜像地址下载,repo init...巴拉巴拉的,这里repo就是git的封装,怎么下载怎么运行,不多说了,百度一下.下载哪个版本 ...

  4. 编译Android系统源码--搭建环境

    下载Ubantu14 Google官方建议使用Ubuntu 14 下载路径 双系统安装参考 下载VMware 建议:VMware Workstation 16 Pro 下载路径 下载Android系统 ...

  5. android 系统源码调试 局部变量值_如何方便快速的整编Android 9.0系统源码?

    点击上方"刘望舒",选择"星标" 多点在看,就是真爱! 作者 :  刘望舒  |  来源 :刘望舒的博客地址:http://liuwangshu.cn/fram ...

  6. Android AOSP基础(三)Android系统源码的整编和单编

    本文首发于微信公众号「刘望舒」 关联系列 Android AOSP基础系列 Android系统启动系列 前言 在上一篇文章Android AOSP基础(二)AOSP 源码下载 中,我们顺利的将AOSP ...

  7. Android FrameWork 学习之Android 系统源码调试

    这是很久以前访问掘金的时候 无意间看到的一个关于Android的文章,作者更细心,分阶段的将学习步骤记录在自己博客中,我觉得很有用,想作为分享同时也是留下自己知识的一些欠缺收藏起来,今后做项目的时候会 ...

  8. Android系统源码

    作者:王宇龙 链接:https://www.zhihu.com/question/19759722/answer/29213925 来源:知乎 著作权归作者所有.商业转载请联系作者获得授权,非商业转载 ...

  9. 大牛们是怎么阅读 Android 系统源码的?

    转载自https://www.zhihu.com/question/19759722 作者:王宇龙 链接:https://www.zhihu.com/question/19759722/answer/ ...

最新文章

  1. 美团真的让人无语!背调了一个多星期,跟我说背调不通过!问原因,HR说没办法透露,但可以看其它美团机会...
  2. android 导入开源项目代码常见问题
  3. python中figsize什么意思_matplotlib 设置图形大小时 figsize 与 dpi 的关系
  4. 如何使用CodeSmith批量生成代码
  5. Leetcode 202. 快乐数 解题思路及C++实现
  6. python绘制柱状图,如何改变柱状柱间距,如何设置横纵轴标签(绘制Intel Realsense D435深度误差柱状图)
  7. spring boot 整合web开发之文件上传、静态资源访问、异常处理、返回JSON数据
  8. 计算机网络应用基础第一章试题,计算机网络应用基础第一章测试题
  9. android app自动更新界面_Android自定义view之模仿登录界面文本输入框(华为云APP)...
  10. 面试题58 - II. 左旋转字符串
  11. hibernate 简单笔记(一)
  12. [原创]二维数组的动态分配及参数传递
  13. Forrester报告拆解:强劲冲击第一梯队后,京东智联云站稳云市场新格局
  14. Raki的读paper小记:LOOKING BACK ON LEARNED EXPERIENCES FOR CLASS/TASK INCREMENTAL LEARNING
  15. java下载文件excel格式错乱,excel表格数据错乱如何修复-excel表格里的文件突然格式全部乱了,怎么恢复?...
  16. 相克军oracle dba视频,相克军 Oracle DBA培训视频教程
  17. 关于《JavaScript百炼成仙》电子版,在线阅读地址~
  18. word总页数不包含封面_Word技巧:除去封面后,总页码减1是如何设置的?
  19. 解决POI导出Excel单元格内容换行问题
  20. python Gstreamer 播放不同编码格式的视频文件

热门文章

  1. 哪款蓝牙耳机佩戴比较舒适?佩戴舒适的蓝牙耳机推荐
  2. 电量优化-应用待机模式(实验)
  3. 数组专题讲义之简单排序算法
  4. java 引用 jar包_java命令行引用jar包的方法
  5. 程序员思维训练思维导图
  6. kkb接单平台项目与读书笔记
  7. iOS APP内置WKWebView加载网页获取位置权限弹框文字是英文
  8. TeamViewer文件传输怎么用?
  9. 《迷失岛2》游戏开发框架开发日记:背包基本逻辑
  10. saved_model 转 tensorrt 的 plan 模型