huangcm
2025-09-01 53d8e046ac1bf2ebe94f671983e3d3be059df91a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/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\" $*"