Skip to content

Commit

Permalink
Added screenshot functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
KaanDoesNothing committed Nov 12, 2020
1 parent 91ae8dd commit 0660121
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ class ADB {
y: parseInt(split[1])
}
}

async getScreenshot(dir: string) {
await cmd("adb shell screencap -p /sdcard/screen.png");
await cmd("adb pull /sdcard/screen.png " + dir);
await cmd("adb shell rm /sdcard/screen.png");

return `${dir}/screen.png`;
}
}

export default ADB;

0 comments on commit 0660121

Please sign in to comment.