android 常用ADB命令

发布于 2024-05-18  53 次阅读


adb和fastboot命令示例

adb命令:

adb devices :列出adb设备
adb reboot :重启设备
adb reboot bootloader :重启到fastboot模式
adb reboot recovery :重启到recovery模式
adb reboot edl :重启到edl(9008)模式

fastboot命令:

fastboot devices :列出fastboot设备
fastboot reboot :重启设备
fastboot reboot-bootloader :重启到fastboot模式
fastboot reboot recovery :重启到Recovery模式
fastboot flash <分区名称> <镜像文件名> :刷写分区
fastboot oem reboot-<模式名称> :重启到相应模式
fastboot oem device-info :查看解锁状态
fastboot oem edl :重启到edl(9008)模式

fastboot flash用法举例:

fastboot flash recovery D:\recovery.img //刷入REC分区
fastboot flash boot D:\boot.img //刷入boot分区

android A/B槽位切换

重启进入fastboot

reset -f

切换

fastboot set_active a //使a槽位变成active
fastboot set_active b //使b槽位变成active

查看当前槽位

fastboot getvar current-slot 

A->B:swdl_utils -d 0 -l 1
B->A:swdl_utils -d 1 -l 1