当前位置: 首页 > news >正文

Docker - Android源码编译与烧写

创建源代码 并挂载到win目录
docker run -v /mnt/f/android8.0:/data/android8.0 -it --name android8.0 49a981f2b85f /bin/bash

使用 docker update 命令动态调整内存限制:

重新运行一个容器
docker run -m 512m my_container

修改运行中容器
显示运行中容器
docker ps
这将把容器的内存限制设置为 512 兆字节。如果你想增加内存限制,可以将 --memory 参数的值调整为更大的值。
docker update --memory 512m <container_id_or_name>
重启
docker restart <container_id_or_name>

显示容器内存以及 cpu使用情况
docker stats <container_id_or_name>

修改容器核心数量

重新运行一个容器
docker run --cpus 2 my_image

修改运行中容器
显示运行中容器
docker ps
更新容器的 CPU 核心数
docker update --cpus 2 <container_id_or_name>
重启
docker restart <container_id_or_name>

修改WSL的核心数和内存容量
在这里插入图片描述
新建WSL配置文件

# Settings apply across all Linux distros running on WSL 2
[wsl2]# Limits VM memory to use no more than 4 GB, this can be set as whole numbers using GB or MB
memory=8GB # Sets the VM to use two virtual processors
processors=24# Specify a custom Linux kernel to use with your installed distros. The default kernel used can be found at https://github.com/microsoft/WSL2-Linux-Kernel
# kernel=C:\\temp\\myCustomKernel# Sets additional kernel parameters, in this case enabling older Linux base images such as Centos 6
# kernelCommandLine = vsyscall=emulate# Sets amount of swap storage space to 8GB, default is 25% of available RAM
# swap=8GB# Sets swapfile path location, default is %USERPROFILE%\AppData\Local\Temp\swap.vhdx
# swapfile=C:\\temp\\wsl-swap.vhdx# Disable page reporting so WSL retains all allocated memory claimed from Windows and releases none back when free
# pageReporting=false# Turn off default connection to bind WSL 2 localhost to Windows localhost
# localhostforwarding=true# Disables nested virtualization
# nestedVirtualization=false# Turns on output console showing contents of dmesg when opening a WSL 2 distro for debugging
# debugConsole=true

User/bin/bash: rsync: command not found
sudo apt-get update
sudo apt-get install rsync

编译成功 撒花✨✨✨
在这里插入图片描述

挂载输出目录
docker run -it -v /mnt/f/out:/mnt/f/out --name android-8.0.0_r17_env_v1.0 9d7f84ef799b /bin/bash

导出系统镜像
cp system.img /mnt/f/out/⭐⭐

同步文件夹
rsync -av /root/android8.0/out/target/product/angler/*.txt /mnt/f/out/⭐⭐⭐⭐

root@ce0fbb39ab6f:~/android8.0/out/target/product/angler# rsync -av --exclude='*/' /root/android8.0/out/target/product/angler/*.img  /mnt/f/out/
sending incremental file list
boot.img
cache.img
ramdisk-recovery.img
ramdisk.img
recovery.img
system.img
userdata.img
vendor.imgsent 1,375,517,306 bytes  received 168 bytes  119,610,215.13 bytes/sec
total size is 1,375,181,071  speedup is 1.00

烧写
参考Framework入门のPiex 6P源码(下载/编译/刷机)

fastboot erase cache \
fastboot flash boot boot.img \
fastboot flash recovery recovery.img \
fastboot flash system system.img \
fastboot flash userdata userdata.img \
fastboot flash cache cache.img \
fastboot flash vendor vendor.img \
fastboot reboot

验证编译时间

adb shell getprop ro.build.date.utc
#2023-12-12 15:36:25
1702366585 

释放内存
关闭wsl,释放vmmem
wsl --shutdown

完结撒花✨🌸🎉

https://lixiaogang03.github.io/2020/11/08/Docker-Android/
https://segmentfault.com/a/1190000039970343

http://www.lryc.cn/news/261877.html

相关文章:

  • 股票价格预测 | Python实现基于ARIMA和LSTM的股票预测模型(含XGBoost特征重要性衡量)
  • Base64
  • 二叉搜索树的简单C++类实现
  • 禁毒知识竞赛流程和规则
  • CSS 基础
  • 黑色翻页时钟HTML源码-倒计时单页翻页时钟
  • 2043杨辉三角(C语言)
  • 【机器学习】从底层手写实现线性回归
  • 判断数组中对象的某个值是否有相同的并去重
  • Shell脚本 变量 语句 表达式
  • MIT6.S081-实验准备
  • 工具在手,创作无忧:一键下载安装Auto CAD工具,让艺术创作更加轻松愉悦!
  • 第25节: Vue3 带组件
  • ubuntu apache2配置反向代理
  • 【数据挖掘 | 关联规则】FP-grow算法详解(附详细代码、案例实战、学习资源)
  • 力扣题目学习笔记(OC + Swift) 11
  • JVM基础入门
  • 前端真的死了吗
  • 前后端分离开发
  • 向量数据库——AI时代的基座
  • 【️什么是分布式系统的一致性 ?】
  • 鸿蒙ArkTS Web组件加载空白的问题原因及解决方案
  • 【Java】网络编程-UDP回响服务器客户端简单代码编写
  • 【设计模式】之工厂模式
  • 70.爬楼梯
  • 【论文解读】ICLR 2024高分作:ViT需要寄存器
  • 【Redis】AOF 基础
  • C语言—每日选择题—Day50
  • [C/C++]——内存管理
  • PDF文件的限制编辑,如何设置?