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.