Android源码编译并烧录操作方法
本人使用的是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手机上也有相应提示,写入后重启手机等待即可。
推荐阅读
-
android apk反编译到java源码的实现方法
-
Android中实现地址栏输入网址能浏览该地址网页源码并操作访问网络
-
Android笔记之:CM9源码下载与编译的应用
-
Android中实现地址栏输入网址能浏览该地址网页源码并操作访问网络
-
Android8.1源码编译实践(Mac)
-
自己编译Android(小米5)内核并刷入(一键自动编译打包)
-
Android 7.1.1系统源码下载、编译、刷机-Nexus 6实战
-
Android源码分析(一)-----如何快速掌握Android编译文件
-
Android编程调用系统自带的拍照功能并返回JPG文件示例【附demo源码下载】
-
android根据项目把文件编译到文件系统中操作方法