Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.util.Scanner;
- class Screenshots {
- public static void main(String args[]) {
- BufferedReader bufferedReader = null;
- Scanner scanner=new Scanner(System.in);
- int pageno=1;
- try {
- int n=scanner.nextInt();
- while(pageno<n){
- System.out.println("Wait...");
- // Runtime.getRuntime().exec("adb exec-out screencap -p > " +pageno+".png");
- // Runtime.getRuntime().exec("adb shell input swipe 300 700 50 700");
- Process p1=new ProcessBuilder(new String[]{"cmd.exe","/c","adb exec-out screencap -p >" +pageno+".png"}).start();
- Process p2=new ProcessBuilder(new String[] {"cmd.exe","/c"," adb shell input swipe 300 700 50 700"}).start();
- p1.waitFor();
- p2.waitFor();
- pageno++;
- }
- } catch (Exception e) {
- System.out.println("Error");
- }
- }
- }
Add Comment
Please, Sign In to add comment