Projects & Stories

Flash your recovery image via adb shell on android

//edit: You need a rooted device for this kind of flashing

Hi, ever wondered about how you can flash a recovery.img via adb shell?

A lot of posts suggest flashing it via fastboot. Well my Samsung phone is not detected by fastboot. Then there is the option to install a dubious binary file which is called flash_image.. thank u internet!

Well damn I have the recover.img whats so hard to use dd and flash it with a single shell command? For those who don't know much about linux commands here we go;

Enable your USB debugging bridge in switch via adb to the terminal:

./adb shell

Then you should be able to find your recovery partion with:

DEV=$(ls /dev/block/platform/*/by-name/recovery); echo $DEV

that should output something like this:


If this is the case you only have to put the recovery.img on your sd-card or the internal storage and you are one command from flashing:

dd of=$DEV if=/external_sd/recovery.img

Thats it! No binaries you have to install. No fastboot udev rules :S

You can enter into your new recovery system with:

./adb reboot recovery