Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reboot offline Android device remotely

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

like image 820
Matthias Braun Avatar asked Mar 26 '26 00:03

Matthias Braun


1 Answers

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.

like image 82
Kurru Avatar answered Mar 28 '26 17:03

Kurru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!