-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
Copy pathadb_run_on_device.sh
executable file
·33 lines (26 loc) · 1.23 KB
/
adb_run_on_device.sh
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
31
32
33
#!/bin/bash
# This script will build and run this app on an Android device via
# adb. You must set the HL_TARGET environment variable prior to
# running this script, e.g.
# HL_TARGET=arm-64-android adb_run_on_device.sh
DEVICE_PATH=/data/local/tmp/blur
DEVICE_ENV="LD_LIBRARY_PATH=${DEVICE_PATH}:/vendor/lib64 ADSP_LIBRARY_PATH=\"${DEVICE_PATH};/dsp\""
HEXAGON_RUNTIME_PATH=../../src/runtime/hexagon_remote
BIN=bin
# Build the app.
make bin/${HL_TARGET}/test
# Make a folder on device for the app and our dependencies.
adb shell mkdir -p ${DEVICE_PATH}
# Push the Hexagon runtime to $DEVICE_PATH.
if [[ "$HL_TARGET" == *"-hvx"* ]]; then
RUNTIME=${HL_TARGET%%-hvx*}
adb push ${HEXAGON_RUNTIME_PATH}/bin/${RUNTIME}/libhalide_hexagon_host.so ${DEVICE_PATH}
adb push ${HEXAGON_RUNTIME_PATH}/bin/v60/signed_by_debug/libhalide_hexagon_remote_skel.so ${DEVICE_PATH}
# If there's a testsig installed in the usual location, copy it to
# $DEVICE_PATH so it is visible to our modified $ASDP_LIBRARY_PATH.
adb shell cp /system/lib/rfsa/adsp/testsig* ${DEVICE_PATH} > /dev/null || true
fi
# Push and run the app!
adb push ${BIN}/${HL_TARGET}/test ${DEVICE_PATH}
adb shell chmod +x ${DEVICE_PATH}/test
adb shell ${DEVICE_ENV} ${DEVICE_PATH}/test