Index: platform_tools/ios/bin/ios_setup.sh |
diff --git a/platform_tools/ios/bin/ios_setup.sh b/platform_tools/ios/bin/ios_setup.sh |
index 5df7ac00d2cee064b8cbfe1cf711258bee512754..ce4fdc6cb1fd4175f87c9acaa6cbb35f24c4c711 100755 |
--- a/platform_tools/ios/bin/ios_setup.sh |
+++ b/platform_tools/ios/bin/ios_setup.sh |
@@ -24,9 +24,6 @@ TEST_RUNNER_BUNDLE_ID="com.google.iOSShell" |
# Directory with the Skia source. |
SKIA_SRC_DIR=$(cd "${SCRIPT_DIR}/../../.."; pwd) |
-# BuildTYPE is 'Debug' by default. |
-BUILDTYPE="Debug" |
- |
# Provisioning profile - this needs to be set up on the local machine. |
PROVISIONING_PROFILE="9e88090d-abed-4e89-b106-3eff3512d31f" |
@@ -37,12 +34,11 @@ IOS_BUNDLE_ID="com.google.iOSShell" |
IOS_RESULTS_DIR="results" |
-if [[ $# -ge 1 ]]; then |
- BUILDTYPE=$1 |
+# BUILDTYPE is 'Debug' by default. |
+if [[ -z "$BUILDTYPE" ]]; then |
+ BUILDTYPE="Debug" |
fi |
-set -x |
- |
ios_uninstall_app() { |
ideviceinstaller -U "$IOS_BUNDLE_ID" |
} |
@@ -58,7 +54,7 @@ ios_install_app() { |
cd $RET_DIR |
} |
-ios_rmdir() { |
+ios_rm() { |
local TARGET="$IOS_MOUNT_POINT/$IOS_DOCS_DIR/$1" |
ios_mount |
@@ -73,11 +69,19 @@ ios_mkdir() { |
ios_umount |
} |
+ios_cat() { |
+ local TARGET="$IOS_MOUNT_POINT/$IOS_DOCS_DIR/$1" |
+ ios_mount |
+ RET="$(cat $TARGET)" |
+ ios_umount |
+ echo -e "$RET" |
+} |
+ |
# ios_mount: mounts the iOS device for reading or writing. |
ios_mount() { |
- # If this is already mounted we return. |
+ # If this is already mounted we unmount it. |
borenet
2015/05/05 13:36:30
Nit: line ending with spaces
stephana-chromium
2015/05/05 14:30:54
Done.
|
if $(mount | grep --quiet "$IOS_MOUNT_POINT"); then |
- echo "Device already mounted at: $IOS_MOUNT_POINT - Unmounting." |
+ >&2 echo "Device already mounted at: $IOS_MOUNT_POINT - Unmounting." |
ios_umount |
fi |
@@ -87,7 +91,7 @@ ios_mount() { |
fi |
ifuse --container $TEST_RUNNER_BUNDLE_ID $IOS_MOUNT_POINT |
sleep 1 |
- echo "Successfully mounted device." |
+ >&2 echo "Successfully mounted device." |
} |
# ios_umount: unmounts the ios device. |
@@ -105,11 +109,15 @@ ios_restart() { |
# The path is relative to the 'Documents' folder on the device. |
ios_pull() { |
# read input params |
- local IOS_SRC="$1" |
+ local IOS_SRC="$IOS_MOUNT_POINT/$IOS_DOCS_DIR/$1" |
local HOST_DST="$2" |
ios_mount |
- cp -r $IOS_MOUNT_POINT/$IOS_DOCS_DIR/$IOS_SRC $HOST_DST |
+ if [[ -d "${HOST_DST}" ]]; then |
+ cp -r "$IOS_SRC/" "$HOST_DST" |
+ else |
+ cp -r "$IOS_SRC" "$HOST_DST" |
+ fi |
ios_umount |
} |