Android 使用fastboot烧录镜像

全编代码,将out/target/product/msm8909(msm8909为当前软件版本)下的所有image拿出来,放到一个目录,在该目录编写一个bash脚本:(我的生成的镜像就这么多,其他软件版本可能略有不同,需自行修改)
adb reboot bootloader

sudo fastboot flash boot boot.img
sudo fastboot flash cache cache.img
sudo fastboot flash dt dt.img
sudo fastboot flash fota fota.img
sudo fastboot flash persist persist.img
sudo fastboot flash ramdisk ramdisk.img
sudo fastboot flash ramdisk-recovery ramdisk-recovery.img
sudo fastboot flash recovery recovery.img
sudo fastboot flash splash splash.img
sudo fastboot flash system system.img
sudo fastboot flash userdata userdata.img

sudo fastboot reboot

在当前目录执行脚本(前提是手机可以进fastboot,之前手机一直进不了fastboot,adb reboot bootloader后一直wait for device,原来设备做过定制,关机后同时按某些键+开机键才进的去fast boot)

fastbootimg$ . mp02\ fastboot.sh 
error: device '(null)' not found
target reported max download size of 262144000 bytes
sending 'boot' (8525 KB)...
OKAY [  0.269s]
writing 'boot'...
OKAY [  0.261s]
finished. total time: 0.531s
target reported max download size of 262144000 bytes
erasing 'cache'...
OKAY [  0.046s]
sending 'cache' (6248 KB)...
OKAY [  0.200s]
writing 'cache'...
OKAY [  0.191s]
finished. total time: 0.437s
target reported max download size of 262144000 bytes
sending 'dt' (148 KB)...
OKAY [  0.009s]
writing 'dt'...
FAILED (remote: partition table doesn't exist)
finished. total time: 0.014s
target reported max download size of 262144000 bytes
sending 'fota' (7264 KB)...
OKAY [  0.230s]
writing 'fota'...
OKAY [  0.233s]
finished. total time: 0.463s
target reported max download size of 262144000 bytes
sending 'persist' (4716 KB)...
OKAY [  0.150s]
writing 'persist'...
OKAY [  0.149s]
finished. total time: 0.300s
target reported max download size of 262144000 bytes
sending 'ramdisk' (1176 KB)...
OKAY [  0.040s]
writing 'ramdisk'...
FAILED (remote: partition table doesn't exist)
finished. total time: 0.045s
target reported max download size of 262144000 bytes
sending 'ramdisk-recovery' (1543 KB)...
OKAY [  0.051s]
writing 'ramdisk-recovery'...
FAILED (remote: partition table doesn't exist)
finished. total time: 0.055s
target reported max download size of 262144000 bytes
sending 'recovery' (8891 KB)...
OKAY [  0.281s]
writing 'recovery'...
OKAY [  0.271s]
finished. total time: 0.552s
target reported max download size of 262144000 bytes
sending 'splash' (225 KB)...
OKAY [  0.012s]
writing 'splash'...
OKAY [  0.013s]
finished. total time: 0.025s
target reported max download size of 262144000 bytes
erasing 'system'...
OKAY [  0.509s]
sending sparse 'system' (254832 KB)...
OKAY [  8.457s]
writing 'system'...
OKAY [  8.324s]
sending sparse 'system' (255878 KB)...
OKAY [  8.564s]
writing 'system'...
OKAY [  8.636s]
sending sparse 'system' (253277 KB)...
OKAY [  8.329s]
writing 'system'...
OKAY [  8.298s]
sending sparse 'system' (102030 KB)...
OKAY [  3.409s]
writing 'system'...
OKAY [  3.146s]
finished. total time: 57.672s
target reported max download size of 262144000 bytes
erasing 'userdata'...
OKAY [  0.217s]
sending 'userdata' (88723 KB)...
OKAY [  2.802s]
writing 'userdata'...
OKAY [  2.757s]
finished. total time: 5.776s
rebooting...

finished. total time: 0.051s

猜你喜欢

转载自blog.csdn.net/u011109881/article/details/79382874
今日推荐