Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cre4ture committed Apr 27, 2024
1 parent 3c2becc commit 915597d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions util/android-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ take_screen_shot() {
adb exec-out screencap -p > "$filename"
}

# shellcheck disable=SC2317 # Don't warn about unreachable commands in this function
check_if_termux_is_active() {
dumsys=$(adb shell "dumpsys window windows")
echo "dumpsys: $dumsys"
echo "$dumsys" | grep -E "imeInputTarget in display# 0 Window{[^}]+com.termux\/com\.termux\.HomeActivity}"
}

# shellcheck disable=SC2317 # Don't warn about unreachable commands in this function
adb_shell_start_termux_activity() {
if ! adb shell 'am start -n com.termux/.HomeActivity'; then
Expand All @@ -129,8 +136,7 @@ adb_shell_start_termux_activity() {
take_screen_shot "launch_termux_after_start_activity"

# the emulator can sometimes be a little slow to launch the app
run_with_retry 20 bash -c "sleep 1 && adb shell 'dumpsys window windows' | \
grep -E \"imeInputTarget in display# 0 Window{[^}]+com.termux\/com\.termux\.HomeActivity}\""
run_with_retry 20 check_if_termux_is_active
}

launch_termux() {
Expand Down

0 comments on commit 915597d

Please sign in to comment.