编译android源码官方教程(5)编译完之后刷机、编译fastboot
Running Builds
This page provides details for running builds on specific devices and is designed to complement the information in Building the System.
2.Building fastboot and adb
If you don't already have fastboot and adb, you can build them with the regular build system. Use the instructions in Building a System and replace the main make command with:
$ make fastboot adb
3.Booting into fastboot mode
During a cold boot of a device, use the following key combinations to boot into fastboot mode, which is a mode in the bootloader that can be used to flash the device:
| Device | Keys |
|---|---|
| hikey | Link pins 1 - 2 and 5 - 6 of J15 |
| angler | Press and hold Volume Down, then press and hold Power |
| bullhead | Press and hold Volume Down, then press and hold Power |
| shamu | Press and hold Volume Down, then press and hold Power |
| fugu | Press and hold Power |
| volantis | Press and hold Volume Down, then press and hold Power |
| hammerhead | Press and hold both Volume Up and Volume Down, then press and hold Power |
| flo | Press and hold Volume Down, then press and hold Power |
| deb | Press and hold Volume Down, then press and hold Power |
| manta | Press and hold both Volume Up and Volume Down, then press and hold Power |
| mako | Press and hold Volume Down, then press and hold Power |
| grouper | Press and hold Volume Down, then press and hold Power |
| tilapia | Press and hold Volume Down, then press and hold Power |
| phantasm | Power the device, cover it with one hand after the LEDs light up and until they turn red |
| maguro | Press and hold both Volume Up and Volume Down, then press and hold Power |
| toro | Press and hold both Volume Up and Volume Down, then press and hold Power |
| toroplus | Press and hold both Volume Up and Volume Down, then press and hold Power |
| panda | Press and hold Input, then press Power |
| wingray | Press and hold Volume Down, then press and hold Power |
| crespo | Press and hold Volume Up, then press and hold Power |
| crespo4g | Press and hold Volume Up, then press and hold Power |
You can also use the command adb reboot bootloader to reboot from Android directly into the bootloader with no key combinations.
4.Unlocking the bootloader
It's possible to flash a custom system only if the bootloader allows it, and the bootloader is locked by default. You can unlock the bootloader, but be aware that doing so deletes the user data for privacy reasons (the unlock operation needs to run only once). After unlocking, all data on the device is erased, i.e. both the applications' private data and the shared data that is accessible over USB, including photos and movies. Be sure to back up any precious files before unlocking the bootloader.
With the device in fastboot mode, unlock the bootloader using:
$ fastboot oem unlock
The procedure must be confirmed on-screen.
On Nexus 10, after unlocking the bootloader, the internal storage remains unformatted. You can format the device using:
$ fastboot format cache
$ fastboot format userdata
To re-lock the bootloader, use:
$ fastboot oem lock
Note: Re-locking the bootloading on a Motorola Xoom erases user data (including the shared USB data).
5.Using Flash Unlock
Android 7.0 introduces a new system API, getFlashLockState(), to transmit bootloader state.
Android 7.0 added the following system API that returns the bootloader’s lock status on compliant devices:
PersistentDataBlockManager.getFlashLockState()
| Return value | Conditions |
|---|---|
FLASH_LOCK_UNKNOWN |
Returned only by devices upgrading to Android 7.0 that have not supported bootloader changes required to get the flash lock status if they support flashing lock/unlock capability.
New Android 7.0 devices must be in either |
FLASH_LOCK_LOCKED |
Should be returned by any device that does not support flashing lock/unlock (i.e. the device is always locked), or any device that does support flashing lock/unlock and is in the locked state. |
FLASH_LOCK_UNLOCKED |
Returned by any device that supports flashing lock/unlock and is currently in the unlocked state. |
5.1 Examples and source
In the Android 7.0 release, the Android Open Source Project (AOSP) contains a reference implementation that returns a value based on the ro.boot.flash.locked boot property.
The code lives in:
frameworks/base/services/core/java/com/android/server/PersistentDataBlockService.java
frameworks/base/core/java/android/service/persistentdata/PersistentDataBlockManager.java
5.2 Validation
Manufacturers should test the values returned by devices with locked and unlocked bootloaders.
6.Selecting a device build
The recommended builds for devices are available from the lunch menu, accessed when running the lunchcommand with no arguments. You can download factory images and binaries for Nexus devices from developers.google.com:
- Preview binaries (blobs)
- Factory images for released devices
- Support binaries (drivers) for release devices
See Obtaining proprietary binaries for more details and Device binaries requirements for other resources.
| Device | Code name | Build configuration |
|---|---|---|
| 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) | nakasi (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 |
| PandaBoard (Archived) | panda | aosp_panda-userdebug |
| Motorola Xoom (U.S. Wi-Fi) | wingray | full_wingray-userdebug |
| Nexus S | soju (crespo) | full_crespo-userdebug |
| Nexus S 4G | sojus (crespo4g) | full_crespo4g-userdebug |
Note: Do not use Android 4.1.1 on a Nexus 7 originally sold with Android 4.1.2 or newer.
7.Flashing a device
You can flash an entire Android system in a single command; doing so verifies the system being flashed is compatible with the installed bootloader and radio, writes the boot, recovery, and system partitions together, and then reboots the system. Flashing also erases all user data, similarly to fastboot oem unlock.
Place the device in fastboot mode either manually by holding the appropriate key combination at boot, or from the shell with:
$ adb reboot bootloader
Once the device is in fastboot mode, run:
$ fastboot flashall -w
The -w option wipes the /data partition on the device; this is useful for your first time flashing a particular device but is otherwise unnecessary.
Note: Filesystems created via fastboot on Motorola Xoom do not function optimally. We recommend re-creating filesystems through recovery, using: $ adb reboot recovery. While in recovery, open the menu (press Power + Volume Up), wipe the cache partition, then wipe data.
8.Restoring devices to factory state
Factory images for Nexus 5, Nexus 10, Nexus 4, Nexus Q, Nexus 7, Galaxy Nexus (GSM/HSPA+ "yakju" and "takju", and CDMA/LTE "mysid" and "mysidspr"), Nexus S, and Nexus S 4G are available from Google's factory image page.
Factory images for the Motorola Xoom are distributed directly by Motorola.
编译android源码官方教程(5)编译完之后刷机、编译fastboot的更多相关文章
- 编译android源码官方教程(2)建立编译环境「linux & mac osx」
https://source.android.com/source/initializing.html Establishing a Build Environment IN THIS DOCUMEN ...
- 编译android源码官方教程(6)编译内核
Building Kernels IN THIS DOCUMENT Selecting a kernel Identifying kernel version Downloading sources ...
- 编译android源码官方教程(4)开始编译
Preparing to Build IN THIS DOCUMENT Obtain proprietary binaries Download proprietary binaries Extrac ...
- 编译android源码官方教程(3)下载代码
https://source.android.com/source/downloading.html Downloading the Source IN THIS DOCUMENT Installin ...
- 编译android源码官方教程(1)硬件、系统要求
https://source.android.com/source/requirements.html Requirements IN THIS DOCUMENT Hardware requireme ...
- 在ubuntu16.04上编译android源码【转】
本文转载自:http://blog.csdn.net/fuchaosz/article/details/51487585 1 前言 经过3天奋战,终于在Ubuntu 16.04上把Android 6. ...
- 深入浅出 - Android系统移植与平台开发(五)- 编译Android源码(转)
2.3编译Android源码 Android源码体积非常庞大,由Dalvik虚拟机.Linux内核.编译系统.框架代码.Android定制C库.测试套件.系统应用程序等部分组成,在编译Android源 ...
- 【转】在Ubuntu下编译Android源码并运行Emulator
原文网址:http://www.mcuos.com/thread-4553-1-1.html 建立编译环境 1.在VirtualBox上安装Ubuntu 2.安装JDK $ sudo apt-ge ...
- Ubuntu12.04编译Android4.0.1源码全过程-----附wubi安装ubuntu编译android源码硬盘空间不够的问题解决
昨晚在编译源码,make一段时间之后报错如下: # A fatal error has been detected by the Java Runtime Environment: # # SIGSE ...
随机推荐
- C++之路进阶——bzoj2152(聪聪可可)
F.A.Qs Home Discuss ProblemSet Status Ranklist Contest ModifyUser hyxzc Logout 捐赠本站 Notice:由于本OJ建立在 ...
- linux第6天 流协议-粘包
今天学习的主要是对第5天的加强. 比如服务器的多进程,点对点应用聊天程序.父进程子进程互发消息.等等. 流协议-粘包 一般TCP协议会出现粘包,粘包产生的原因一般为.TCP协议是流式传输,不会根据用户 ...
- spark history-server的使用
为什么需要historyServer? 在运行Spark Application的时候,Spark会提供一个WEBUI列出应用程序的运行时信息:但该WEBUI随着Application的完成(成功/失 ...
- react绑定事件
1.显示隐藏 2.输入框输入内容,立即显示出来 代码如下: 注意:版本 React v15.0.1 ReactDOM v15.0.1 browser.min.js是编译文件,将代码解析为浏览器识别的j ...
- sql 中英文格式的时间转数字格式
select receiveBillDt,CONVERT(varchar(100), cast(receiveBillDt as datetime), 21),a.LoanDate from Prot ...
- logstash配合filebeat监控tomcat日志
环境:logstash版本:5.0.1&&filebeat 5.0.1 ABC为三台服务器.保证彼此tcp能够相互连接. Index服务器A - 接收BC两台服务器的tomcat日志 ...
- 夺命雷公狗---DEDECMS----5快速入门之商城快速搭建实现快递方式和支付方式的显示
我们现在用dedecms快速搭建一个商场,方法如下所示: 如此类推.写多几个栏目,效果 如下所示: 然后我们添加几个商品,记得要刷新下页面噢,不见见不到商品 添加成功后去看看效果如何: 出来了,但是如 ...
- 夺命雷公狗---微信开发52----网页授权(oauth2.0)获取用户基本信息接口(2)
我们在上一节课已经发送code给第三方了,那么这就要获取code去换取到用户的openid. 第一步:编写create_baseurl.php(上一节课程已经写完了) 第二步:编写vote1.php( ...
- 【py】安装ipython-notebook
os:ubunutu(debian)-based linux 分两步: 安装ipython及其依赖包 sudo apt-get install ipython-notebook 安装可选的附加工具 ...
- YeoMan 与Angularjs
链接地址: Yeoman:强大的web构建工具 http://hao.jobbole.com/yeoman/ Yeoman官方教程:用Yeoman和AngularJS做Web应用 http://blo ...