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

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

Issue 352303003: Push resources to Android device (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: little style fix Created 6 years, 6 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
« no previous file with comments | « platform_tools/android/bin/android_run_skia ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9ca8454ab5e7ebcd5cb1e1e0643d8d3224465fd9..4a7326bf86fff1dcc6e627d903ce981b17109863 100755
--- a/platform_tools/android/bin/android_setup.sh
+++ b/platform_tools/android/bin/android_setup.sh
@@ -11,6 +11,10 @@ while (( "$#" )); do
if [[ "$1" == "-d" ]]; then
DEVICE_ID=$2
shift
+ elif [[ "$1" == "-i" || "$1" == "--resourcePath" ]]; then
+ RESOURCE_PATH=$2
+ APP_ARGS=("${APP_ARGS[@]}" "${1}" "${2}")
+ shift
elif [[ "$1" == "-s" ]]; then
DEVICE_SERIAL="-s $2"
shift
@@ -205,11 +209,12 @@ adb_push_if_needed() {
source $SCRIPT_DIR/utils/setup_adb.sh
# read input params
- HOST_SRC="$1"
- ANDROID_DST="$2"
+ local HOST_SRC="$1"
+ local ANDROID_DST="$2"
ANDROID_LS=`$ADB $DEVICE_SERIAL shell ls -ld $ANDROID_DST`
- if [ "${ANDROID_LS:0:1}" == "d" ];
+ HOST_LS=`ls -ld $HOST_SRC`
+ if [ "${ANDROID_LS:0:1}" == "d" -a "${HOST_LS:0:1}" == "-" ];
then
ANDROID_DST="${ANDROID_DST}/$(basename ${HOST_SRC})"
fi
@@ -229,10 +234,20 @@ adb_push_if_needed() {
echo -n "$ANDROID_DST "
$ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST
fi
+ elif [ "${ANDROID_LS:0:1}" == "d" ]; then
+ for FILE_ITEM in `ls $HOST_SRC`; do
+ adb_push_if_needed "${HOST_SRC}/${FILE_ITEM}" "${ANDROID_DST}/${FILE_ITEM}"
+ done
else
- echo -n "$ANDROID_DST "
- $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")"
- $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST
+ HOST_LS=`ls -ld $HOST_SRC`
+ if [ "${HOST_LS:0:1}" == "d" ]; then
+ $ADB $DEVICE_SERIAL shell mkdir -p $ANDROID_DST
+ adb_push_if_needed $HOST_SRC $ANDROID_DST
+ else
+ echo -n "$ANDROID_DST "
+ $ADB $DEVICE_SERIAL shell mkdir -p "$(dirname "$ANDROID_DST")"
+ $ADB $DEVICE_SERIAL push $HOST_SRC $ANDROID_DST
+ fi
fi
}
« no previous file with comments | « platform_tools/android/bin/android_run_skia ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698