Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: platform_tools/android/bin/android_setup.sh

Issue 22617002: Update Skia Android tools. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: platform_tools/android/bin/android_setup.sh
diff --git a/platform_tools/android/bin/android_setup.sh b/platform_tools/android/bin/android_setup.sh
index db1145f5d1120c043f54b683dc56ce0417c467f0..f86d62c7fe185aee13a91da84be92ce958125359 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -10,7 +10,7 @@ while (( "$#" )); do
DEVICE_ID=$2
shift
else
- APP_ARGS="$APP_ARGS $1"
+ APP_ARGS=("${APP_ARGS[@]}" "${1}")
fi
shift
@@ -210,6 +210,7 @@ setup_device() {
esac
echo "The build is targeting the device: $TARGET_DEVICE"
+ export DEVICE_ID="$TARGET_DEVICE"
# Set up the toolchain.
setup_toolchain
@@ -258,6 +259,42 @@ adb_pull_if_needed() {
fi
}
+# adb_push_if_needed(host_src, android_dst)
+adb_push_if_needed() {
+
+ # get adb location
+ source $SCRIPT_DIR/utils/setup_adb.sh
+
+ # read input params
+ HOST_SRC="$1"
+ ANDROID_DST="$2"
+
+ ANDROID_LS=`$ADB shell ls -ld $ANDROID_DST`
+ if [ "${ANDROID_LS:0:1}" == "d" ];
+ then
+ ANDROID_DST="${ANDROID_DST}/$(basename ${HOST_SRC})"
+ fi
+
+ echo "ANDROID: $ANDROID_DST"
+
+ ANDROID_LS=`$ADB shell ls -ld $ANDROID_DST`
+ if [ "${ANDROID_LS:0:1}" == "-" ];
+ then
+ #get the MD5 for dst and src
+ ANDROID_MD5=`$ADB shell md5 $ANDROID_DST`
+ HOST_MD5=`md5sum $HOST_SRC`
+
+ if [ "${ANDROID_MD5:0:32}" != "${HOST_MD5:0:32}" ];
+ then
+ $ADB push $HOST_SRC $ANDROID_DST
+# else
+# echo "md5 match of android [${ANDROID_DST}] and host [${HOST_SRC}]"
+ fi
+ else
+ $ADB push $HOST_SRC $ANDROID_DST
+ fi
+}
+
# Set up the device.
setup_device "${DEVICE_ID}"
if [[ "$?" != "0" ]]; then

Powered by Google App Engine
This is Rietveld 408576698