欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

Android源码编译并烧录操作方法

程序员文章站 2022-04-25 19:56:04
本人使用的是nexus s手机,在aosp官网查看得知分支以及产品名如下: nexus s soju (crespo) full_crespo-userdebug 进入bootloade...

本人使用的是nexus s手机,在aosp官网查看得知分支以及产品名如下:

nexus s soju (crespo) full_crespo-userdebug

进入bootloader

adb reboot bootloader

解锁bootloader命令

新设备

fastboot flashing unlock
旧设备
fastboot oem unlock

反之,加锁命令

 

fastboot flashing lock
fastboot oem lock

lunch命令选择对应的手机与编译的产品名表,留下备用:

selecting a device build

the recommended builds for devices are available from the lunchmenu, accessed when running the lunch command with no arguments.you can download factory images and binaries for nexus devices fromdevelopers.google.com. see devicebinaries for downloads. for details and additional resources, see obtaining proprietarybinaries.

device code name build configuration
pixel xl marlin aosp_marlin-userdebug
pixel sailfish aosp_sailfish-userdebug
hikey hikey hikey-userdebug
nexus 6p angler aosp_angler-userdebug
nexus 5x bullhead aosp_bullhead-userdebug
nexus 6 shamu aosp_shamu-userdebug
nexus player fugu aosp_fugu-userdebug
nexus 9 volantis (flounder) aosp_flounder-userdebug
nexus 5 (gsm/lte) hammerhead aosp_hammerhead-userdebug
nexus 7 (wi-fi) razor (flo) aosp_flo-userdebug
nexus 7 (mobile) razorg (deb) aosp_deb-userdebug
nexus 10 mantaray (manta) full_manta-userdebug
nexus 4 occam (mako) full_mako-userdebug
nexus 7 (wi-fi) cracked (grouper) full_grouper-userdebug
nexus 7 (mobile) nakasig (tilapia) full_tilapia-userdebug
galaxy nexus (gsm/hspa+) yakju (maguro) full_maguro-userdebug
galaxy nexus (verizon) mysid (toro) aosp_toro-userdebug
galaxy nexus (experimental) mysidspr (toroplus) aosp_toroplus-userdebug
motorola xoom (u.s. wi-fi) wingray full_wingray-userdebug
nexus s soju (curly) full_crespo-userdebug
nexus s 4g sojus (crespo4g) full_crespo4g-userdebug

刷入所有镜像文件命令 ,-w选项会擦除手机data区数据,

sudo fastboot flashall -w

刷入部分文件,如system.img文件

sudo fastboot flash system out/target/product/crespo/system.img

其他文件(可选)

sudo fastboot flash boot out/target/product/crespo/boot.img

sudo fastboot flash userdata out/target/product/crespo/userdata.img

sudo fastboot flash ramdisk out/target/product/crespo/ramdisk.img

还有其他img同理

刷入system.img后显示如下

writing 'system'...
okay [ 25.443s]
finished. total time: 49.291s
手机上也有相应提示,写入后重启手机等待即可。