How To Recover A Bricked Device Using Fastboot

How To Recover A Bricked Device Using Fastboot

It’s an inevitable part of the Android hacking process that you will ‘soft brick’ your device from time to time. Normally these are pretty trivial problems, the device gets stuck in a boot loop for example. And normally you can fix them by wiping your data and cache and then reflashing your ROM, or just by restoring your Nandroid backup.

But sometimes the problem can be harder to diagnose.Maybe your custom Recovery was accidentally overwritten with the stock one, which has no advanced features. Or maybe you can’t boot into Recovery at all.

Well, there’s still a solution for most devices. It’s called Fastboot. This is a feature of the Android software development (SDK) and enables you to communicate with your device when it is connected to your desktop computer via USB. In Fastboot you can flash a new custom Recovery, or flash a new ROM itself and wipe the device completely and return it to stock if needed.

Fastboot is available on most Android devices, excluding Samsung where it is not implemented. For a Galaxy device you need to use the Odin tool to flash a new ROM or Recovery (the unofficial site samsung-updates.com normally has the latest version available to download). On Nexus and HTC devices Fastboot is an invaluable tool, and can be a phone saver.

Get the SDK

1

Download the Android SDK from http://developer.android.com/sdk. There are versions for Windows, Mac and Linux so your desktop platform of choice is supported. There’s no need to install the SDK since we’re not using it to develop apps, we simply want to use one of its associated tools.

 

Boot device to Fastboot

2

Now boot your device into Fastboot. This is done using the key combination used to boot into Recovery – power and volume down on a Nexus 7, for example. Don’t boot to Recovery, though. Fastboot is either the screen prior to Recovery or available through a separate menu.

 

 

Locate Fastboot on desktop

3

Return to the desktop and locate the Android Software Development Kit folder. We will be using the Fastboot tool which is stored in the platform-tools sub-folder of the Android SDK. To use it first, simply open a command line on Windows or Terminal on Mac.

 

 

Check your commands

4

Double clicking the Fastboot icon in the platform-tools folder will also give you a list of the various commands you can now use. Once you’re more experienced using the tool you will be able to use multiple commands at the same time, adding the various options to configure more powerful functions.

 

 

Change directory

5

Now change the directory to that of the platform-tools folder in the Android SDK. All you need to do this is type the command cd followed by the full path to the platform-tools folder. For example, cd/Users/name/Desktop/android-sdk-mac_x86/platform-tools. That will change the directory.

 

 

Check fastboot mode

6

Connect your device – already in Fastboot – to your desktop computer via USB. check that the device is recognised by typing fastboot devices in the command line. On Mac and Linux all Fastboot commands need to be preceded by./ (so type ./fastboot devices). Your connected device’s serial number should now be listed.

 

 

How to wipe

7

In some instances if data or other files are causing problems with your Android device you may need to wipe it completely in order to be able to get it working again. Luckily, it’s a really straightforward procedure. To do this type fastboot -w in the terminal window and your device’s storage will be cleared.

 

 

Flash a Recovery

8

To flash a new custom Recovery, first download the recovery image (for example, from www.clockworkmod.com) and then place it in the platform-tools folder for easy access. Begin flashing the Recovery with the command:  fastboot flash recovery [recoveryimage.img]. Do not disconnect the device while it is in progress.

 

 

Flash a ROM

9

Once you’ve flashed a custom Recovery you can use that to flash a ROM. Alternatively you can flash through Fastboot. Download the ROM and place it in the platform-tools folder. To start flashing, type fastboot update [romfile.zip]. This will take a few minutes to complete, so do not touch the device while it is working.

 

Reboot

10

Your device may reboot once the flashing process is completed, but if not, you can also reboot via our friend Fastboot. Simply type fastboot reboot and the device will restart. Remember that after flashing a new ROM the first boot may take longer – give it a good ten minutes to allow it to do its thing.

 

Here is a list of Fastboot Commands for you to use:

fastboot
usage: fastboot [ <option> ] <command>

commands:
update <filename>                        reflash device from update.zip
flashall                                           flash boot + recovery + system
flash <partition> [ <filename> ]     write a file to a flash partition
erase <partition>                          erase a flash partition
format <partition>                         format a flash partition
getvar <variable>                         display a bootloader variable
boot <kernel> [ <ramdisk> ]         download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ]    create bootimage and flash it
devices                                            list all connected devices
continue                                          continue with autoboot
reboot                                              reboot device normally
reboot-bootloader                            reboot device into bootloader
help                                                 show this help message

options:
-w                                       erase userdata and cache (and format
if supported by partition type)
-u                                       do not first erase partition before  formatting
-s <specific device>          specify device serial number or path to device port
-l                                         with “devices”, lists device paths
-p <product>                      specify product name
-c <cmdline>                     override kernel commandline
-i <vendor id>                   specify a custom USB vendor id
-b <base_addr>                 specify a custom kernel base address
-n <page size>                  specify the nand page size. default: 2048
-S <size>[K|M|G]                automatically sparse files greater than size.  0 to disable

  • Chrys

    When I try to go to recovery I get boot loader 91.7B
    Err: A5,90,4e,00,2F. My computer registers that I plugged it in but neither fastboot or adb lists the device as being plugged in.

  • Techsider

    Do you have a more in-depth guide on fastbooot and how to unbrick using ONLY fastboot commands?