Recovery Mode

A recovery mode is a mode in Android used to update or modify the operating system. There are two types of recovery mode: Stock recovery, shipped from manufacturer, and custom recovery, installed manually by user after unlocking device's bootloader.
Stock recovery is mainly used to install update from manufacturer or wipe device data. Custom recovery is mostly used to flash an unsigned zip, do a Nandroid backup & restore, and reformatting device.
This mode contains a Linux kernel with ramdisk on the /recovery partition, separated from the /system partition. It is a Linux-like system without the Android subsystem.
Recovery mode can be useful when a phone is stuck in a bootloop or when it has been infected with malware.
This is initiated when androidboot.mode= is set to androidboot.mode=recovery after the key combos are being held and detected and sets that string to =recovery.
==Options==
These are such options you can use in the recovery mode:
===Reboot system now===
This option reboots the device.
===Reboot to bootloader===
This options enters Download Mode. If booted to recovery from the charging screen it may enter fastboot mode.
=== Enter fastboot ===
This enables fastbootd mode. This option appears in some devices.
===Apply update from ADB/SD Card===
This updates the system from ADB (adb sideload [zip]) or SD Card.
===Wipe data/Factory reset===
This is the most useful option. Warning: It erases data from your phone. once this is done the data CANNOT BE UNDONE. Make sure to back up your data before doing so.
===Wipe cache partition===
This option erases the /cache partition.
===Mount /system===
This option mounts the /system folder. (a.k.a mounting the hidden folder)
===View recovery logs===
This is for debugging. This option views the recovery logs from the /cache folder.
===Run graphics test===
This option runs the graphics test.
===Run locale test===
This option runs the locale test.
===Power off===
This option powers off the device.
===Repair apps===
This option appears in some devices. This option repairs any corrupted apps.
== Enablement ==
The way of entering recovery is different for every vendor.
Examples:
* Zebra and symbol devices: left scan/action button
* Nexus 7: Volume Up + Volume Down + Power
* Samsung Galaxy S3: Volume Up + Home + Power
* Motorola Droid X: Home + Power
* Older Samsung devices [home]
* Samsung Galaxy A10s and all Xiaomi devices: Volume Up + Power
*
Another way to enter Android Recovery is by booting into fastboot and selecting Recovery Mode, or typing adb reboot recovery on a computer. This will bring you to the No Command screen shown above or display the recovery menu immediately.
On custom recoveries, ADB will see the device in recovery and show this output.
List of devices attached
<serial-no.> recovery
And using the shell command gives you root access and gives you this output:
:/ #
Category:Modes