If your phone has an unlocked bootloader, you can use the fastboot command to flash the factory image. It sounds like something that laymen can't understand, but when you need to upgrade a rooted device, repair a broken phone, restore to the original system, or enjoy Android updates earlier than others, it is the best way.
Similar to ADB, fastboot is a powerful command line tool for Android. It might sound intimidating - don't worry, once you learn about it, you'll know the inner workings of Android and how to fix the most common problems. A note about Samsung devices The following guide will work for most Nexus, Pixel, HTC, and Motorola devices, as well as phones and tablets from many other manufacturers. However, Samsung devices have their own flashing software, so your Galaxy device will not support Fastboot. For Samsung devices, the best way to flash is to use Odin, which we have provided in the link below. Step 1: Install ADB and Fastboot on your computer First, you need to install ADB and Fastboot on your computer. Only with them can you use Fastboot commands to flash the image. There are many "one-click installation versions" or "green versions" of ADB and Fastboot on the Internet, but I don't recommend installing such versions. They are not updated as fast as the official versions, so they may not be fully compatible with the new version of the device. You must install the Android SDK Tools from Google. This is what "real" ADB and Fastboot are. Installing the SDK Tools may take a little while, but it's worth the wait. In Method 1 below, I'll explain how to install this software on Windows, Mac, and Linux, so jump there to get started. Step 2: OEM Unlocking In order to flash an image using Fastboot, you need to unlock your device's bootloader. If you have already unlocked it, you can skip this step and go to step 3. If your device's Android version is 6.0 or above, you need to enable a setting before you unlock the bootloader. First, you need to enable Developer Options. After enabling it, go to the "Developer Options Menu" and then enable the "OEM Unlock" option. Then you can proceed to the next step. If your device does not have this option, then your device may not be running Android 6.0 or above. If this option is present but greyed out, it means your bootloader cannot be unlocked, which means you cannot use Fastboot to flash an image to your phone. Step 3: Enter Bootloader mode Before using Fastboot software, you also need to put your device into bootloader mode. The specific way to enter it depends on your device. For most phones, you'll need to completely turn off your phone first. After the screen goes black, press and hold the Power button and the Volume Down button at the same time for about 10 seconds. If this doesn't work, turn off your phone and hold the volume down button. Then connect your phone to your computer using a USB cable and wait a few seconds. If that doesn't work, press the volume up button instead and try the second method. Soon you should see a bootloader screen like this:
After you see this interface, make sure your device is connected to the computer. All the work from now on will be done on the computer, just place your phone there. Step 4 Open a command line window for ADB on your computer Go to the directory where you installed ADB and Fastboot. For Windows users, this is usually C:\Program Files (x86)\Android\android-sdk\platform-tools. For Mac and Linux users, it depends on where you unzipped ADB when you installed the tools, so if you forget where you did it, search your hard drive for platform-tools. In the installation directory, if you are using a Windows PC, hold down the Shift key on your keyboard, right-click in an empty space in the file manager, and select "Open command window here." If you are using Mac or Linux, you just need to open a terminal and go to platform-tools. Step 5: Unlock the bootloader You only need to do this once, so if your bootloader is already unlocked, you can skip this step. Otherwise, you will need to run one more command - note that this command will erase all data on your device. Before entering the commands, I need to point out that the following commands are only applicable to Windows. Mac users need to add a period and a slash (./) before each command, and Linux users need to add a slash (/). So, type the following command in ADB Shell and press Enter.
If the program outputs a string of characters ending with fastboot, then your device is connected properly and you can continue. If not, go back to step 1 and check if your ADB and Fastooot are installed correctly, and then make sure the device has entered bootloader mode as shown in step 3. After that, unlock your bootloader. Due to the difference of Android versions, we have two ways to solve this problem. If your device's Android version is 5.0 or lower, enter the following command:
If your Android version is 6.0 or higher, enter the following command and press Enter:
Send the unlock command to an Android phone running version 6.0 or higher At this point, your Android phone will ask you if you are sure you want to unlock the bootloader. Make sure you select the "Yes" option, if not, use the volume button to select "Yes". Then press the power button, your device will begin to unlock and then reboot into Fastboot mode. The unlock menu on the Nexus 6P. Image via Dallas Thomas/Gadget Hacks Step 6: Download the factory image Now that your bootloader is unlocked, you're ready to flash the factory image -- but you need to download the image first. Below are links to download factory images for common devices.
Using the link above, locate your device model in the list and download the latest firmware to your computer. If your manufacturer is not listed, try doing a google search for "factory images for ." Step 7: Flash the factory image Now it's time to flash the image. First unzip the factory image file you downloaded from the manufacturer's website. I recommend 7-Zip, which is free and supports most formats. Unzip the factory image Next, move the contents of the zip file to your ADB installation folder. Then open a command line window here. For more information, see step 4. Factory images are moved to platform-tools files In addition to the above, you have two other ways to flash the image. I will describe them separately below. Method 1: Use the flash-all script Most factory images will include a flash-all script that allows you to complete the flashing process with a single command. If you are trying to restore your black brick, this is the easiest way. However, this will return your phone to a non-rooted state and will erase all data. If you don't want this, choose method 2. To run the flash-all script, enter the following command and press Enter:
Run the "flash-all" command This will take a while, but once it's done, your phone should reboot automatically and you'll be able to enjoy 100% stock firmware. Method 2: Manually decompress and flash the image You can manually flash a system image. This requires extra work, but it can be used to unroot, upgrade your device, or recover a bricked device without wiping data. First, unzip all the compressed files in the factory image package. Usually the compressed file contains three or four folders stacked on top of each other. Make sure you have unzipped all the compressed files. Then move these files to platform-tools - or in other words, don't put them in any subfolders. Move all files extracted from the factory image package to the platform-tools directory Among these files, there are two images that can be deleted directly: cache.img and userdata.img. These two files clear your device data. If you don't flash these two images, your data will not disappear. Of the remaining files, there are six images that make up the core of Android: boot, bootloader, radio, recovery, system, and vendor. The boot image contains the kernel, so if you ever want to replace a home-made kernel that doesn't work well, you can just flash this file. This is done by typing:
The next one is the bootloader image - the interface you use to flash the image. If you want to upgrade the bootloader, enter the following command:
After doing this, you can flash the image with the new bootloader. To do this, type:
Next is the radio image. This image controls your device's network connection. If your phone's Wi-Fi or mobile data is having problems, or you just want to upgrade your radio, type:
Then comes recovery. Depending on your previous modifications, you may choose to flash this image or not. For example, if you have already flashed TWRP, flashing this image will overwrite your modifications and replace it with stock recovery. If you just want to upgrade your modified device, you can skip this step. If you want a new version of stock recovery, type:
The next one is the big one: the system image, which contains all the files needed for the Android system. It is the most important part of the upgrade process. If you don't want to upgrade the system, but just want to switch back to the stock firmware or repair the brick, you only need to flash this image, which contains all the files of Android. In other words, if you only flash this file, all the changes you made to the device will be cancelled. As a general method to fix a brick, and to upgrade Android, type:
*** is the vendor image. Only newer devices contain this package. If it is not there, don't worry. However, if it is there, it contains some important files. Type the following command to update it:
After this, you can restart your device:
Manually flash the factory images one by one At this point, your device is fully updated, and if you are fixing a brick, your phone should be running perfectly. If you know what each system image does, you will have a better understanding of how Android works. Manually flashing images has helped me understand Android more than any modification. You will find that Android is just a bunch of images written to the storage device, and now you can handle them yourself, you can also better deal with root-related issues. |
<<: Weird Java question: Why does 128 == 128 return False, but 127 == 127 returns True?
>>: Android Chronicles (14): Android 2.3 Gingerbread — The first major UI change
Late October to early November is an unstable per...
The official version of iOS 14.5 is finally avail...
The Beijing Winter Olympics are getting closer! T...
When it comes to community operation and manageme...
"Tomorrow has its own beauty, and today has ...
This is the 3602nd article of Da Yi Xiao Hu A bus...
The best-selling beauty courses and beauty accoun...
After marriage, women pay more attention to beddi...
In 1920, General Motors hired American inventor C...
Introduction to the practical course resources fo...
On January 25, Beijing New Oriental School’s annu...
Living things are the most inspiring, but also di...
The news that has been circulating for a day has f...
As the product size grows, the number and types o...
After working on Amazon for so many years, everyo...