http://blog.csdn.net/linuxzhouying/article/details/7166679
1、见到网上一篇刷乐phone的帖子很好所以记录下来:
adb devices查看已连接设备
adb reboot-bootloader 让手机进入fastboot模式
fastboot devices可以看到设备列表
用下面的命令烧写boot、systerm、和userdata
fastboot flash boot path\boot.img
fastboot flash system path\system.img
fastboot flash userdata path\userdata.img
然后用fastboot reboot重启设备
2、fastboot相关使用
系统区(system),数据缓存区(cache),用户数据区(userdata)。
1. 查看fastboot命令的帮助:
fastboot
显示如下信息:
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall "flash boot" + "flash system"
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
reboot reboot device normally
reboot-bootloader reboot device into bootloader
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
2. 擦除分区:
fastboot erase {partition} 例:fastboot erase boot或fastboot erase system等。
fastboot oem format 进行格式化
fastboot erase cache 清除cache
fastboot flash {partition} {*.img} 例:fastboot flash boot boot.img或fastboot flash system system.img等。
4. 烧写所有分区:
fastboot flashall 注意:此命令会在当前目录中查找所有img文件,将这些img文件烧写到所有对应的分区中,并重新启动手机。
5. 一次烧写boot,system,recovery分区:
(1)创建包含boot.img,system.img,recovery.img文件的zip包。
(2)执行:fastboot update {*.zip}
6. 烧写开机画面:
fastboot flash splash1 开机画面
7. 重启手机:
fastboot reboot
用fastboot大刷Android ~换个方法刷android手机
下面把我自己总结的一些方法写出来,希望能给广大G友在刷机路上助一臂之力。
先要下载fastboot for windows:
只有一个文件,下载后随便放在你能找到的地方.在正式讲刷机之前先讲一下android的分区知识 :
splash1:开机画面,使用Nandroid backup备份系统后的文件为splash1.img
recovery:该分区是恢复模式(即开机按Home+power进入的界面),使用Nandroid backup备份为recovery.img
boot:内核启动分区,使用Nandroid backup备份为boot.img
system:Android系统部分,目录表示为/system,通常为只读,使用Nandroid backup备份为system.img
cache:缓存文件夹,目录表示为/cache,事实上除了T-mobile的OTA更新外,别无用处,使用Nandroid backup备份为cache.img
userdata:用户安装的软件以及各种数据,目录为/data,使用Nandroid backup备份为data.img
因此对于刷机一般可以这么理解:
1. 修改开机画面, 修改的是splash1
2. root时刷的是所有分区
3. 刷test_keys,更新的应该是recovery
4. 使用update.zip刷是更新boot、system
5. 恢复出厂设置, 清空的是userdata和cache
明白这些之后就很好理解,一般无须更新recovery.IMG,正常情况下只需要更新BOOT和SYSTEM即可.但依我看来这两者是相互依存而不可分割的.好下面开始说刷机步骤。
进入手机的SPL模式(power+相机) ,且驱动已经安装。
驱动下载: [hide][/hide]
若在我的电脑设备管理中发现此情况,“如下图情况”亦是未正确安装驱动,只需要右键更新驱动,且指向你从我这里下载的驱动即可。
![](http://bbs.blueshow.net/attachment/month_0911/09111912127c315c745b07cfa6.png)
无论你从哪里下载到一个包含boot.img,system.img只要含有这两个文件的文件你就可以刷机了,将刚才下载的fastboot拷贝到此文件夹
![](http://bbs.blueshow.net/attachment/month_0911/091119121224cf5e199957d5b8.png)
在windows下运行CMD这句应该能看懂吧?
用cd命令打开fastboot所在的文件夹。
![](http://bbs.blueshow.net/attachment/month_0911/0911191212c18fcb9493e4cacd.png)
此时可以看见打开的命令行
![](http://bbs.blueshow.net/attachment/month_0911/0911191212e3f97b6a8fa295d6.png)
运行fastboot devices
![](http://bbs.blueshow.net/attachment/month_0911/09111912121b57b3be0855d935.png)
若出现我HTxxxxxxx fastboot,这就证明你已经成功了一半,ok,接下来就是擦除分区,使用fastboot erase xxxx 如下图
![](http://bbs.blueshow.net/attachment/month_0911/0911191212c06a08563d0e936c.png)
只需擦除boot,system,也可以是userdata也可以是recovery。。呵呵
看实际需要了。
接着擦除system
![](http://bbs.blueshow.net/attachment/month_0911/091119121226d66905d359b74d.png)
依然OKAY。。userdata和recovery我就不擦了,,命令也是
Fastboot erase userdata 敲完回车
Fastboot erase recovery 敲完回车。
Ok,擦除完了那就开始刷进去吧。。。
![](http://bbs.blueshow.net/attachment/month_0911/0911191212b5155247dd6a6996.png)
先flash boot.img。命令很简单
接着flash system.img
![](http://bbs.blueshow.net/attachment/month_0911/091119121289e2718e1989226c.png)
也okay,,,像之前备份的userdata或者是recovery,再未擦除就不用在flash了。若需要语法如下Fastboot flash userdata userdata.Img(确定在备份里面是这个名字或者之前又这个分区)
Fastboot flash recovery recovery.img
Ok下一步重启
![](http://bbs.blueshow.net/attachment/month_0911/09111912121faa291cfcc5c3fd.png)
至此刷机全部结束,等待你的小G启动起来就OK了。。
有时需要在电脑端安装apk程序时,这时候是不许用fastboot的,只需要进入SDK-tools下面运行 adb install xxx.apk既可,前提是你要安装的程序和adb同一目录。