Android 使用fastboot燒錄映象
阿新 • • 發佈:2019-02-16
全編程式碼,將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