-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathci_run_android.sh
More file actions
executable file
·45 lines (37 loc) · 998 Bytes
/
ci_run_android.sh
File metadata and controls
executable file
·45 lines (37 loc) · 998 Bytes
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
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -euo pipefail
ATTEMPT_DIR=""
if [[ -n "${ATTEMPT:-}" && "${ATTEMPT}" != "" ]]; then
ATTEMPT_DIR="attempt-${ATTEMPT}"
fi
ARTIFACTS_ROOT="./artifacts"
if [[ -n "$ATTEMPT_DIR" ]]; then
ARTIFACTS_DIR="${ARTIFACTS_ROOT}/${ATTEMPT_DIR}"
else
ARTIFACTS_DIR="${ARTIFACTS_ROOT}"
fi
mkdir -p "${ARTIFACTS_DIR}"
adb logcat -c
LOGFILE="$ARTIFACTS_DIR/logcat.txt"
adb logcat -v threadtime -T 1 -b all > "$LOGFILE" &
LOGCAT_PID=$!
cleanup() {
kill "$LOGCAT_PID" 2>/dev/null || true
wait "$LOGCAT_PID" 2>/dev/null || true
}
trap cleanup EXIT INT TERM
# local/regtest helper ports
if [[ "${BACKEND:-local}" != "mainnet" ]]; then
# regtest electrum port
adb reverse tcp:60001 tcp:60001
# lnd port
adb reverse tcp:9735 tcp:9735
# lnurl server port
adb reverse tcp:30001 tcp:30001
# homegate port
adb reverse tcp:6288 tcp:6288
fi
# show touches
adb shell settings put system show_touches 1
# Pass everything through to WDIO/Mocha
npm run e2e:android -- "$@"