Turn on ADB remotely via USB

拟墨画扇 提交于 2019-12-25 01:05:16

问题


I'am trying to automate some tests and for that I need to launch some ADB commands. The problem is that I need to do a Factory Data Reset during the tests, and after that the USB Debugging option is disabled. Do you guys know a way to turn it on without touching the device?


回答1:


When your development process has progressed to the point of using automated tests - it's a good idea to start using a dedicated development device for testing - the one with an unlocked bootloader and a development Android build loaded.

You can customize such device so it would have USB Debugging enabled by default after FDR and even have your public RSA key preloaded (so your PC will be automatically authenticated by your device).




回答2:


For obvious security reasons, you can't force-enable USB Debugging on a device. Plus, if there were a "command" to enable USB Debugging, it would require USB Debugging to be executed.



来源:https://stackoverflow.com/questions/27607082/turn-on-adb-remotely-via-usb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!