开发者

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜