Using FastBoot to swipe Android devices on MAC

Time:2021-1-14

installHomebrew(installed, skip)

raw.githubusercontent.com If the domain name is contaminated, the host file will be added

199.232.68.133 raw.githubusercontent.com

Install Android tools

brew cask install android-platform-tools

Decompress FastBoot line brush firmware, CD to include boot.img , system.img , cache.img And so on

Start to brush the machine

1. Turn on USB option

[about device] Click the kernel version continuously until it pops up in developer mode

[settings] – > [developer options] – > [USB debugging]

2. ADB view device connection status

[email protected] emmc % adb devices
List of devices attached
1af7de5	device

3. ADB enters FastBoot mode

[email protected] emmc % adb reboot bootloader

4. FastBoot view device

[email protected] emmc % fastboot devices     
1af7de5	fastboot

5. FastBoot erase the old system, write to the new system, and execute the following commands in turn

Erase the partition contents of the old version
 1. fastboot erase boot
 2. fastboot erase system 
 3. fastboot erase userdata 
 4. fastboot erase recovery
 Swipe in the corresponding partition content
 1. fastboot flash boot boot.img
 2. fastboot flash system system.img
 3. fastboot flash userdata userdata.img
 4. fastboot flash recovery recovery.img
 Restart it
    fastboot reboot
[email protected] emmc % fastboot erase boot
Erasing 'boot'                                     OKAY [  0.004s]
Finished. Total time: 0.012s
[email protected] emmc % fastboot erase system
Erasing 'system'                                   OKAY [  0.004s]
Finished. Total time: 0.011s
[email protected] emmc % fastboot erase userdata
Erasing 'userdata'                                 OKAY [  0.005s]
Finished. Total time: 0.013s
[email protected] emmc % fastboot erase recovery
Erasing 'recovery'                                 OKAY [  0.004s]
Finished. Total time: 0.013s
[email protected] emmc % fastboot flash boot boot.img
Sending 'boot' (6388 KB)                           OKAY [  0.207s]
Writing 'boot'                                     OKAY [  0.506s]
Finished. Total time: 0.724s
[email protected] emmc % fastboot flash system system.img
Sending 'system' (511318 KB)                       ERROR: usb_ Write failed with status e00002eb // if there is an error like this, you can wait about 3 minutes after the error is reported (although I am reporting an error, I am actually writing), and then proceed to the next step
FAILED (Write to device failed in SendBuffer() (No such file or directory))
fastboot: error: Command failed
[email protected] emmc % fastboot flash userdata userdata.img
Sending 'userdata' (35889 KB)                      OKAY [  1.198s]
Writing 'userdata'                                 OKAY [  2.083s]
Finished. Total time: 3.300s
[email protected] emmc % fastboot flash recovery recovery.img
Sending 'recovery' (6778 KB)                       OKAY [  0.229s]
Writing 'recovery'                                 OKAY [  0.331s]
Finished. Total time: 0.572s
[email protected] emmc % fastboot reboot
Rebooting

6.Okay!