skia2/bin/droid
Hal Canary 9db44ed0ef bin/droid script: fix wierd mkdir error on my device
Here's the error:
    adb: error: failed to copy '...' to '...':
    remote secure_mkdirs failed: Operation not permitted

I also cleaned up the script.

No-Try: true
Change-Id: Ie2dec7b42eaf2a19475cdd0a04074f8bec47b2fb
Reviewed-on: https://skia-review.googlesource.com/148906
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-08-23 14:46:19 +00:00

31 lines
650 B
Bash
Executable File

#!/bin/bash
# Run a GN-built Android binary on the connected device.
#
# Example usage:
# $ ninja -C out dm
# $ droid out/dm --src gm --config gpu
#
# See https://skia.org/user/quick/gn for build instructions.
dst_dir=/data/local/tmp
path="$1"
name="$(basename "$path")"
shift
if ! [ -d resources ]; then
echo run this from the skia tree
exit 1
fi
dirs=''
for dir in $(find resources -type d); do dirs="$dirs \"${dir}\""; done
set -e
set -x
adb shell "cd \"$dst_dir\"; mkdir -p $dirs"
adb push --sync resources "${dst_dir}/"
adb push --sync "$path" "${dst_dir}/${name}"
adb shell "cd \"$dst_dir\"; chmod +x \"$name\"; \"./$name\" $*"