getsdcardpath, getscreenshotpath, getlastscreenshot
Added a few new functions to envsetup.sh: - getsdcardpath() returns the sdcard path. This will be more useful when multiuser storage complicates the sdcard path. - getscreenshotpath() returns the path to screenshots - getlastscreenshot() adb pulls the most recently-taken screenshot Change-Id: I851145088344dff6f1672f0a423201f3aa3e4390
This commit is contained in:
22
envsetup.sh
22
envsetup.sh
@@ -979,6 +979,28 @@ function getbugreports()
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getsdcardpath()
|
||||||
|
{
|
||||||
|
adb ${adbOptions} shell echo -n \$\{EXTERNAL_STORAGE\}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getscreenshotpath()
|
||||||
|
{
|
||||||
|
echo "$(getsdcardpath)/Pictures/Screenshots"
|
||||||
|
}
|
||||||
|
|
||||||
|
function getlastscreenshot()
|
||||||
|
{
|
||||||
|
local screenshot_path=$(getscreenshotpath)
|
||||||
|
local screenshot=`adb ${adbOptions} ls ${screenshot_path} | grep Screenshot_[0-9-]*.*\.png | sort -rk 3 | cut -d " " -f 4 | head -n 1`
|
||||||
|
if [ "$screenshot" = "" ]; then
|
||||||
|
echo "No screenshots found."
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
echo "${screenshot}"
|
||||||
|
adb ${adbOptions} pull ${screenshot_path}/${screenshot}
|
||||||
|
}
|
||||||
|
|
||||||
function startviewserver()
|
function startviewserver()
|
||||||
{
|
{
|
||||||
local port=4939
|
local port=4939
|
||||||
|
Reference in New Issue
Block a user