[Fix] (trace-replay): avoid Android startup race

This commit is contained in:
2026-07-04 08:55:43 +08:00
parent 0a138276f8
commit e5ef9b2ace
+4 -1
View File
@@ -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