观心静

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
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("设备连接成功...");
    	
	}
    }

posted on 2017-08-17 11:02  观心静  阅读(1204)  评论(0编辑  收藏  举报