首页
/
每日頭條
/
科技
/
怎樣利用fastboot刷機
怎樣利用fastboot刷機
更新时间:2025-09-16 09:59:51

開機引導模式下使用。此文說明主要适用android 6.0及以上版本

下載以下幾個文件,CMD命令窗口切換到此目錄就可使用了,當然還要安裝USB驅動、打開USB調試(可選):

怎樣利用fastboot刷機(手機刷機調試命令)1

adb工具

怎麼進入此模式

  • 手機端:電源鍵 音量減/加
  • 電腦端:用ADB工具,命令:adb reboot bootloader

格式: fastboot [OPTION...] COMMAND...

版本:與1.0.41版的adb适應

flashing: 寫入命令

update ZIP : Flash all partitions from an update.zip package. 如fastboot update xxx.zip , xxx.zip中包含boot.img, recovery.img, system.img等鏡像文件

flashall : Flash all partitions from $ANDROID_PRODUCT_OUT. On A/B devices, flashed slot is set as active. Secondary images may be flashed to inactive slot. 會自動搜索當前目錄下的所有img文件,将它們都刷入系統對應分區。

flash PARTITION [FILENAME] : Flash given partition, using the image from $ANDROID_PRODUCT_OUT if no filename is given. 這裡的PARTITION有boot/recovery/system/userdata/cache等

fastboot flash boot boot.img 将當前目錄下的boot.img文件刷進系統的boot分區 fastboot flash recovery recovery.img 将當前目錄下的recovery.img文件刷進系統的recovery分區 例子: c:\tmp\fastboot>fastboot flash boot C:\tmp\F103_BAK\boot20220118.img Sending 'boot' (16384 KB) OKAY [ 1.583s] Writing 'boot' OKAY [ 0.355s] Finished. Total time: 2.011s c:\tmp\fastboot>fastboot flash recovery C:\tmp\F103_BAK\recovery20220118.img Sending 'recovery' (16384 KB) OKAY [ 1.584s] Writing 'recovery' OKAY [ 0.354s] Finished. Total time: 2.001s

basics:

devices [-l] : List devices in bootloader (-l: with device paths).

c:\tmp\fastboot>fastboot devices 000007CF00632D90 fastboot 顯示以fastboot結尾的設備号 c:\adb\adb32>adb devices * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attached 8T8HBIZSBU9PCM4S device adb時顯示以device結尾

getvar NAME : Display given bootloader variable.

reboot [bootloader] : Reboot device.

fastboot reboot 重新啟動到正常模式 fastboot reboot bootloader 重新啟動到引導模式 fastboot reboot recovery 重新啟動到恢複模式 例子: c:\tmp\fastboot>fastboot reboot bootloader android 5.0及以上可用此命令 Rebooting into bootloader OKAY [ 0.003s] Finished. Total time: 0.007s c:\tmp\fastboot>fastboot reboot Rebooting OKAY [ 0.002s] Finished. Total time: 0.006s

locking/unlocking:上鎖/解鎖命令,将會删除個人數據

flashing lock|unlock : Lock/unlock partitions for flashing

fastboot flashing lock 給BL上鎖 fastboot flashing unlock 解BL鎖

flashing lock_critical|unlock_critical : Lock/unlock 'critical' bootloader partitions.

flashing get_unlock_ability : Check whether unlocking is allowed (1) or not(0).

advanced:

erase PARTITION : Erase a flash partition.

format[:FS_TYPE[:SIZE]] PARTITION : Format a flash partition.

set_active SLOT : Set the active slot.

oem [COMMAND...] : Execute OEM-specific command. 這裡的command主要是自定義的命令(慎用)。高版本的系統可用fastboot oem help 查詢有效的命令。

android 6.0以前: fastboot oem lock 上BL鎖 fastboot oem unlock 解BL鎖 c:\tmp\fastboot>fastboot oem unlock OKAY [ 30.582s] Finished. Total time: 30.591s 另一個手機的解鎖: c:\tmp\fastboot>fastboot oem unlock (bootloader) Start unlock flow OKAY [ 29.972s] Finished. Total time: 29.983s c:\tmp\fastboot>fastboot oem lock (bootloader) Start lock flow OKAY [ 43.440s] Finished. Total time: 43.449s C:\tmp\fastboot-1>fastboot oem reboot-recovery 重啟到recovery模式 OKAY [ 0.003s] Finished. Total time: 0.050s 還有:fastboot oem reboot-bootloader

查詢設備BL上鎖情況: fastboot oem get_bootinfo 此處的get_bootinfo是用戶自定義命令 C:\tmp\fastboot>fastboot oem device-info (bootloader) Verity mode: true (bootloader) Device unlocked: false (bootloader) Device critical unlocked: false (bootloader) Charger screen enabled: true OKAY [ 0.013s] Finished. Total time: 0.018s

gsi wipe|disable : Wipe or disable a GSI installation (fastbootd only).

wipe-super [SUPER_EMPTY] : Wipe the super partition. This will reset it to contain an empty set of default dynamic partitions.

boot image: 用指定鏡像文件臨時啟動系統,不會更改原系統的啟動文件,如利用magisk加入root權限的boot文件啟動

boot KERNEL [RAMDISK [SECOND]] : Download and boot kernel from RAM.

用magisk_patched-23000_EJX2G.img(加了面具的boot.img)啟動手機例子: C:\tmp\fastboot>fastboot boot C:\tmp\fastboot\magisk_patched-23000_EJX2G.img Sending 'boot.img' (16384 KB) OKAY [ 1.573s] Booting OKAY [ 0.060s] Finished. Total time: 1.678s

flash:raw PARTITION KERNEL [RAMDISK [SECOND]] : Create boot image and flash it.

--dtb DTB : Specify path to DTB for boot image header version 2.

--cmdline CMDLINE : Override kernel command line.

--base ADDRESS : Set kernel base address (default: 0x10000000).

--kernel-offset : Set kernel offset (default: 0x00008000).

--ramdisk-offset : Set ramdisk offset (default: 0x01000000).

--tags-offset : Set tags offset (default: 0x00000100).

--dtb-offset : Set dtb offset (default: 0x01100000).

--page-size BYTES : Set flash page size (default: 2048).

--header-version VERSION : Set boot image header version.

--os-version MAJOR[.MINOR[.PATCH]] : Set boot image OS version (default: 0.0.0).

--os-patch-level YYYY-MM-DD : Set boot image OS security patch level.

Android Things:

stage IN_FILE : Sends given file to stage for the next command.

get_staged OUT_FILE : Writes data staged by the last command to a file.

options: 選項參數

-w : Wipe userdata.

-s SERIAL : Specify a USB device.

-s tcp|udp:HOST[:PORT] : Specify a network device.

-S SIZE[K|M|G] : Break into sparse files no larger than SIZE.

--force : Force a flash operation that may be unsafe.

--slot SLOT : Use SLOT; 'all' for both slots, 'other' for non-current slot (default: current active slot).

--set-active[=SLOT] : Sets the active slot before rebooting.

--skip-secondary : Don't flash secondary slots in flashall/update.

--skip-reboot : Don't reboot device after flashing.

--disable-verity : Sets disable-verity when flashing vbmeta.

--disable-verification : Sets disable-verification when flashing vbmeta.

--unbuffered : Don't buffer input or output.

--verbose, -v : Verbose output.

--version : Display version.

--help, -h : Show this message.

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
推荐阅读
led電視與液晶電視的區别
led電視與液晶電視的區别
led電視與液晶電視的區别led電視與液晶電視的區别從原理上看,液晶顯示設備有些像是街頭那些廣告燈箱,背後的光源經過一定擴散,均勻地照射在繪有畫面的透明膠片上,從而透射出亮麗的畫面。液晶闆就像是那層膠片,但是其中的畫面是會變的。傳統的液晶顯示設備都采用CCFLS(冷陰極熒光燈,coldcathode...
2025-09-16
靈活運用冷凍室 讓冷凍室成為你快速上菜的好幫手
靈活運用冷凍室 讓冷凍室成為你快速上菜的好幫手
冷藏室堆滿了食材,卻不知道有哪些适合放入空蕩蕩的冷凍室嗎?覺得放入冷凍室的食材解凍後都不再新鮮了嗎?答案是:不一定!有些食材放入冷凍室,是更适合的保存方式哦!靈活運用冷凍室,今天開始讓冷凍室成為你快速上菜的好幫手!下面跟随作文庫知識百科了解一下吧!早在1988年,美國食品藥物管理局(FDA)就表示冷...
2025-09-16
如何選購冰箱
如何選購冰箱
電冰箱家裡用的常用電器,是保持恒定地低溫的一種制冷設備,它可以使食物以及其他物品的保持低溫,在日常生活中的也是比較常用的,經常性的使用它主要是對于一些嗯食物進行很好的保存,主要是可以控制食物中細菌的衍生,冰箱也是有非常多的類型,日常生活中的冰箱,在選購方面的要清楚的了解否則在選購方面容易出現一些誤區...
2025-09-16
使用便攜式冰箱的注意事項
使用便攜式冰箱的注意事項
使用便攜式冰箱的注意事項使用便攜式冰箱的注意事項便攜式冰箱箱内的保管:1、便攜式冰箱箱内有時會有露水,此乃正常現象,并非本品有故障,而是使用的環境高溫及多濕,請将蓋子打開,使本體向下,從本體正面排水,也可用幹的抹布将露水擦拭幹淨即可。2、便攜式冰箱在保養時請務必拔下電源插頭,否則會有觸電的危險;請不...
2025-09-16
即熱式電熱水器的安裝及保養方法
即熱式電熱水器的安裝及保養方法
即熱式電熱水器的安裝及保養方法即熱式電熱水器的安裝及保養方法即熱式電熱水器安裝注意事項産品的正确安裝和适當的保養能進一步發揮機器本身的優越性和實用性,從而進一步提高産品的使用壽命,那麼如何對即熱式電熱水器進行保養呢?首先在安裝時請務必讓專業的工作人員或參考說明書要求進行安裝或維護,下面介紹幾個簡單可...
2025-09-16
Copyright 2023-2025 - www.tftnews.com All Rights Reserved