Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#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]
$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
You can’t perform that action at this time.