远程重启离线Android设备

发布于 2024-12-03 02:54:35 字数 442 浏览 1 评论 0原文

我想通过 ADB(或 Monkeyrunner)重新启动已连接但离线的 Motorola Droid 2 设备。 通过 adb Kill-server 重新启动 ADB,然后通过 adb devices 重新启动 ADB 并未使设备恢复在线状态。所以我想我必须重新启动它。如何在不转到离线设备的情况下重新启动?

这是我到目前为止所尝试过的:

  • adb restart
  • adb shell start
  • adb remount

所有这些命令都产生了相同的错误消息: error: device离线

The device is running 2.2, it's in charge only mode and debug is已启用。

预先非常感谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

┊风居住的梦幻卍 2024-12-10 02:54:35

您很可能会在设备上测试您的应用程序,包括 UI,因此一个好的选择是将设备放在附近,尽管这对于单元测试开发来说并非如此。

不幸的是,在设备上进行测试时,您遇到的问题非常常见,最好的解决方案是:

  1. 断开设备连接并重新连接
  2. ,重新启动 adb 服务器,
  3. 断开设备连接,然后重新连接,
  4. 物理上重新启动设备

据我所知,因为 adb 无法发现您的设备,所以也无法与其通信,因此您当前使用 ADB 重新启动它的方法不会让您走得太远。

更复杂的解决方案是安装一个服务应用程序,该应用程序监视来自在线源的“重新启动”指令。然后使用此处中的解决方案重新启动。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文