编译Android源码并烧录

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

Nexus Ssoju (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.

DeviceCode nameBuild configuration
Pixel XLmarlinaosp_marlin-userdebug
Pixelsailfishaosp_sailfish-userdebug
HiKeyhikeyhikey-userdebug
Nexus 6Pangleraosp_angler-userdebug
Nexus 5Xbullheadaosp_bullhead-userdebug
Nexus 6shamuaosp_shamu-userdebug
Nexus Playerfuguaosp_fugu-userdebug
Nexus 9volantis (flounder)aosp_flounder-userdebug
Nexus 5 (GSM/LTE)hammerheadaosp_hammerhead-userdebug
Nexus 7 (Wi-Fi)razor (flo)aosp_flo-userdebug
Nexus 7 (Mobile)razorg (deb)aosp_deb-userdebug
Nexus 10mantaray (manta)full_manta-userdebug
Nexus 4occam (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)wingrayfull_wingray-userdebug
Nexus Ssoju (curly)full_crespo-userdebug
Nexus S 4Gsojus (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
手机上也有相应提示,写入后重启手机等待即可。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值