View Single Post
Old 02-22-2020, 02:44 AM   #776
notimp
Addict
notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.notimp ought to be getting tired of karma fortunes by now.
 
Posts: 248
Karma: 892441
Join Date: Jul 2010
Device: K2i
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.

Last edited by notimp; 02-22-2020 at 02:57 AM.
notimp is offline   Reply With Quote