远程重启离线Android设备
我想通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您很可能会在设备上测试您的应用程序,包括 UI,因此一个好的选择是将设备放在附近,尽管这对于单元测试开发来说并非如此。
不幸的是,在设备上进行测试时,您遇到的问题非常常见,最好的解决方案是:
据我所知,因为 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:
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.