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("设备连接成功...");
}
}