8

I am having some problems with my Samsung Galaxy S2 and I want to start an fschk session on the device.

So, I installed Android SDK with platform-tools. I can access to the device when it's normally rebooted but I couldn't list and connect to the device when it's in recovery mode.

How can I connect via ADB when the device is in recovery mode?

5
  • What OS are you running on? It sounds like the recovery is a stock recovery and therefore un-rooted hence lack of access to adb shell from there.
    – t0mm13b
    Commented Sep 26, 2012 at 15:03
  • I rooted the device about a year ago by following a how-to and didn't update it since then. It runs Android 2.2.3 GINGERBREAD.XWKG1.
    – Tim
    Commented Sep 26, 2012 at 15:13
  • I meant, are you running Windows or Linux?
    – t0mm13b
    Commented Sep 26, 2012 at 15:28
  • I'm not certain that this is possible. I seem to remember that when I was rooting my N7 I was unable to adb while in recovery. I believe you have to be either fully booted or with just the bootloader... booted.
    – SaintWacko
    Commented Sep 26, 2012 at 16:07
  • As I read, it's possible. I am on Windows and I installed the Google's USB drivers. I am trying to install a custom recovery but my phone is acting quite strange. I think I'll try the same steps on Linux.
    – Tim
    Commented Sep 26, 2012 at 16:12

2 Answers 2

9

WARNING: fastboot oem unlock completely wipes your data!

adb is not available in the bootloader, try using fastboot instead

for a quick and dirty rundown of flashing your device with a new image using fastboot:

adb reboot bootloader
use fastboot devices to verify your device is visible, if not, you're probably running windows, and you have to install some funky drivers. if you don't see 'unlocked' at the bottom of the screen, use the command fastboot oem unlock then just:
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot flash recovery recovery.img

If you feel super confident you could just:
adb reboot bootloader && fastboot oem unlock && fastboot flash boot boot.img && fastboot flash system system.img && fastboot flash userdata userdata.img && fastboot flash recovery recovery.img && fastboot reboot

PS You should only use the flash commands if the referenced files are present, if not you may or may not brick your phone (haven't tried flashing a non-existent file to the device yet)

Warning: Unlocking bootloader wipes off data in your phone.

3
  • How we can run these commands when device does not recognized! error: device not found
    – Dr.jacky
    Commented Mar 25, 2015 at 11:09
  • If you're using Winows, install Linux.If you're using Linux - I've never had an issue with bootloader connectivity, so can't help you there. However, if you're talking about for the adb reboot bootloader line, each device is a little different about how to get adb to recognize the device. I suggest you look it up for your particular device.
    – MishaP
    Commented Mar 26, 2015 at 18:02
  • 4
    Holy crap, couldn't you have added a warning that fastboot oem unlock completely wipes your data?
    – Fryie
    Commented Dec 12, 2016 at 18:05
5

Stock recovery doesn't come with ADB access.

Try a recent version of ClockworkMod recovery for your device (the older versions don't all have ADB support)

You will need to flash the recovery on using fastboot (see @MishaP's answer)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .