blob: 53deb5bda64f21b2c9b8cef3b9cf3d4e8ebb8742 [file] [log] [blame]
mtkleinf3155ad2016-09-08 10:03:21 -07001#!/bin/bash
2
3# Run a GN-built Android binary on the connected device.
4#
5# Example usage:
6# $ ninja -C out dm
7# $ droid out/dm --src gm --config gpu
8#
9# See https://skia.org/user/quick/gn for build instructions.
10
Hal Canary9db44ed2018-08-23 10:28:37 -040011dst_dir=/data/local/tmp
12path="$1"
13name="$(basename "$path")"
mtkleinf3155ad2016-09-08 10:03:21 -070014shift
Hal Canary9db44ed2018-08-23 10:28:37 -040015
16if ! [ -d resources ]; then
17 echo run this from the skia tree
18 exit 1
19fi
20
21dirs=''
22for dir in $(find resources -type d); do dirs="$dirs \"${dir}\""; done
mtkleinf3155ad2016-09-08 10:03:21 -070023
24set -e
25set -x
26
Hal Canary9db44ed2018-08-23 10:28:37 -040027adb shell "cd \"$dst_dir\"; mkdir -p $dirs"
28adb push --sync resources "${dst_dir}/"
29adb push --sync "$path" "${dst_dir}/${name}"
30adb shell "cd \"$dst_dir\"; chmod +x \"$name\"; \"./$name\" $*"