Android flash / 刷机基础知识,关于 recovery, bootloader

总览

An Android device consists of several pieces of software, which include the bootloader, radio, recovery, and system.

  • bootloader
    • the first piece of software that is run when your device turns on — it decides whether to load the recovery, or load Android (“system”) and the radio.
  • radio
    • simply the controller for your antennas, which give you a cellular connection to your carrier’s towers
  • recovery
    • simply put, is a runtime environment (think “mini operating system”) separate from Android that can perform various system-related tasks. The stock recovery on most Android devices can apply OTA (over-the-air) updates, delete user and cache content (for factory reset purposes), and allow external tools from a microSD card to run functions on the device.
  • Android booting process, recovery mode, boot-loader/fastboot mode

Third-party Recovery / Custom Recovery

The top two most popular custom recoveries are ClockworkMod (CWM) and Team Win Recovery Project (TWRP).

TWRP 比 CWM 界面易操作,功能更多些。

Other Custom Recoveries

If you’re curious about recoveries other than CWM and TWRP, you should definitely check out the XDA-Developers forum for more recoveries that support your device.

Search by going to your device’s subforum and looking for threads with a “Recovery” tag on them.

刷机版本

Stock Android

Stock Android, also called “vanilla” Android, is the most basic version of the Android operating system available.

Stock Android is also typically not reskinned or redesigned by the phone’s manufacturer (OEM).

ROM

刷机脚本

Nexus 5x - bullhead

  • flash-all.bat

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    @ECHO OFF
    
    PATH=%PATH%;"%SYSTEMROOT%\System32"
    fastboot flash bootloader bootloader-bullhead-bhz31b.img
    fastboot reboot-bootloader
    ping -n 5 127.0.0.1 >nul
    fastboot flash radio radio-bullhead-m8994f-2.6.41.5.01.img
    fastboot reboot-bootloader
    ping -n 5 127.0.0.1 >nul
    fastboot -w update image-bullhead-opm2.171019.029.zip
    
    echo Press any key to exit...
    pause >nul
    exit