3

I would like to reboot a connected but offline Motorola Droid 2 device via ADB (or monkeyrunner). Restarting ADB via adb kill-server and then adb devices has not brought the device back online. So I figure I have to restart it. How can I do a reboot without walking over to the offline device?

Here is what I have tried until now:

  • adb reboot
  • adb shell start
  • adb remount

All those command yielded the same error message: error: device offline

The device is running 2.2, it's in charge only mode and debugging is enabled.

Many thanks in advance

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
  • Related question about offline device status : https://android.stackexchange.com/questions/12491 Can a reset of USB bus help ? if yes how to do this on gnu/linux ? – RzR Oct 07 '11 at 09:13

1 Answers1

4

Most likely you'll be testing your application on the device, including UI so a good option is to have the device nearby, though this is not true for unit test development.

Unfortunately the issue you have come across is very common when testing on a device, and the best solutions are:

  1. disconnect the device and reconnect it
  2. restart the adb server
  3. disconnect the device and reconnect it again
  4. restart the device physically

As far as I am aware, because adb is unable to discover your device, it is unable to communicate with it also, so your current approach with using ADB to restart it won't get you very far.

A more complicated solution would be to install a service application which monitors for a "restart" instruction from an online source. Then use a solution from here to reboot.

Community
  • 1
  • 1
Kurru
  • 14,180
  • 18
  • 64
  • 84
  • So there is absolutely no way to restart an offline device via ADB? Thanks for the tip with the monitor app, but I shy away from the thought of having to write an own app and install it on every test device I have just to restart them when they are offline. I wish there was a way using ADB or monkeyrunner. – Matthias Braun Sep 07 '11 at 09:31
  • I believe if its coming up as "offline" then the communication pathway has failed in some way and so commands cant get through – Kurru Sep 07 '11 at 12:55
  • Thanks Kurru. As it seems I will have to accept this unpleasant news that there is no way to reboot an offline device via ADB. – Matthias Braun Sep 07 '11 at 13:25