From e5ef9b2ace2eff2293c4a0c1d802f6df4b2eb3fa Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sat, 4 Jul 2026 08:55:43 +0800 Subject: [PATCH] [Fix] (trace-replay): avoid Android startup race --- android-plugin/trace-replay-ci.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android-plugin/trace-replay-ci.sh b/android-plugin/trace-replay-ci.sh index 1eaeaff2..a3ded194 100644 --- a/android-plugin/trace-replay-ci.sh +++ b/android-plugin/trace-replay-ci.sh @@ -255,11 +255,14 @@ run_retrace() { adb_device_path shell "$@" app_exited=0 + saw_app_process=0 for _ in $(seq 1 "${timeout_seconds}"); do if adb_device_path shell run-as "${package_name}" ls "${app_dir}/output/result.json" >/dev/null 2>&1; then break fi - if ! adb_device_path shell pidof "${package_name}" >/dev/null 2>&1; then + if adb_device_path shell pidof "${package_name}" >/dev/null 2>&1; then + saw_app_process=1 + elif [ "${saw_app_process}" -eq 1 ]; then app_exited=1 break fi