使用Java让android手机自动执行重复重启

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