Short Script Editor (macOS) script to pull screenshots via adb from a connected android device like the likebook mars and store them in a folder named boyue on the Desktop:
Code:
tell application "Terminal"
do script "echo i can haz screencaps"
end tell
do shell script "/bin/sleep 1.7"
do shell script "/usr/local/bin/adb shell screencap -p /sdcard/screencap.png"
do shell script "mkdir -p ~/Desktop/boyue"
do shell script "/usr/local/bin/adb pull /sdcard/screencap.png ~/Desktop/boyue/screencap.png"
set theFolder to (((path to home folder) as text) & "Desktop:boyue:") as alias
tell application "Finder"
set k to 0
repeat with thisFile in (get document files of theFolder that name contains "screencap" and name extension is "png")
set k to k + 1
get name extension of thisFile
if name of thisFile contains "screencap" then
set name of thisFile to "screencap " & k & "." & result
end if
end repeat
end tell
do shell script "/usr/local/bin/adb shell rm /sdcard/screencap.png"
do shell script "killall Terminal"
Needs android-platform-tools installed via brew as a prerequisite
So:
brew install homebrew/cask/android-platform-tools
after you install brew from here:
https://brew.sh/
Android Debugging needs to be enabled on the Likebook in developer settings. And adb access permissions granted on the device after trying to adb to the device for the first time.