summaryrefslogtreecommitdiffstats
path: root/envsetup.sh
diff options
context:
space:
mode:
authorVictoria Lease <violets@google.com>2012-08-23 11:58:01 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-23 11:58:01 -0700
commitf8c154f4b0b402968a911bf2c00ea40d252ccb60 (patch)
treeabc49e3581b329258ceff7298b942bbac75aa90b /envsetup.sh
parent685ae6dc36b1e4d003f90d499812270405f5e1f9 (diff)
parent1b296b4749f7f77846ab5cf6f5f05e607b20ec31 (diff)
downloadbuild-f8c154f4b0b402968a911bf2c00ea40d252ccb60.zip
build-f8c154f4b0b402968a911bf2c00ea40d252ccb60.tar.gz
build-f8c154f4b0b402968a911bf2c00ea40d252ccb60.tar.bz2
Merge "getsdcardpath, getscreenshotpath, getlastscreenshot" into jb-mr1-dev
Diffstat (limited to 'envsetup.sh')
-rw-r--r--envsetup.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/envsetup.sh b/envsetup.sh
index e31700f..868127c 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -992,6 +992,28 @@ function getbugreports()
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()
{
local port=4939