2016-09-08 17:03:21 +00:00
|
|
|
#!/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.
|
|
|
|
|
2018-08-23 14:28:37 +00:00
|
|
|
dst_dir=/data/local/tmp
|
|
|
|
path="$1"
|
|
|
|
name="$(basename "$path")"
|
2016-09-08 17:03:21 +00:00
|
|
|
shift
|
2018-08-23 14:28:37 +00:00
|
|
|
|
|
|
|
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
|
2016-09-08 17:03:21 +00:00
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2018-08-23 14:28:37 +00:00
|
|
|
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\" $*"
|