Created
October 8, 2016 05:52
-
-
Save DexterHaslem/afb998460fcdc972386afee019ee324d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#expects platform tools in path (usually like AppData\Local\Android\sdk\platform-tools) | |
$ts = [int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalMilliseconds | |
$file = "image$ts.png" | |
if ($args[0]) | |
{ | |
$destdir = $args[0] | |
} | |
else | |
{ | |
$destdir = $pwd.Path | |
} | |
$dest = join-path $destdir $file | |
# while screencap does write to STDOUT, adb converts newlines (COOL) corrupting data | |
adb shell screencap -p /sdcard/$file | |
adb pull /sdcard/$file $dest | |
adb shell rm /sdcard/$file | |
# debug | |
#$f = Read-Host "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment