public static void main(String[] args)throws IOException,Exception {
for(int j=0;j<10;j++) {
Thread.currentThread().sleep(10000);
Process process1 = Runtime.getRuntime().exec("adb reboot");
Thread.currentThread().sleep(5000);
System.out.println("设备重启中。。。");
process1.waitFor();
Process process2 = Runtime.getRuntime().exec("adb wait-for-device");
process2.waitFor();
System.out.println("设备连接成功...");
}
}
本文来自博客园,作者:观心静 ,转载请注明原文链接:https://www.cnblogs.com/guanxinjing/p/9708668.html
本文版权归作者和博客园共有,欢迎转载,但必须给出原文链接,并保留此段声明,否则保留追究法律责任的权利。