Skip to content

v1.3.0 — 等待原语(Wait Primitive)

Choose a tag to compare

@SamXiaBing SamXiaBing released this 21 Aug 02:29
· 13 commits to main since this release

等待原语(Wait Primitive)

Added

  • adb_wait_for 工具:等待设备达到某条件再继续,替代盲目 sleep 固定秒数
  • 条件:device-online(设备上线,不传 serial 等任意设备)/ boot-complete(sys.boot_completed=1)/ process(ps 出现指定进程)/ logcat-pattern(logcat 出现关键字)
  • 轮询到预算上限(默认 30s / 上限 300s);超时返回 matched:false 而非抛错,agent 可对超时做反应;瞬时探测失败不终止
  • agent 编排从「盲等 5 秒」升级为「等 com.example 进程出现后再抓快照」的确定性序列——是台架自动化测试 / 崩溃归因 / 定时巡检的地基原语

Verified:单测 68 全绿(新增 12 例:条件纯函数 4 + 轮询序列 8);真机验证通过(Redmi K50 Pro:device-online / process 均 matched)


EN: adb_wait_for — wait until a device condition holds (device-online / boot-complete / process appeared / logcat keyword), polling up to a budget, returns matched:false on timeout instead of erroring. Turns "sleep 5s after install" into deterministic "wait for the process, then snapshot". 68 unit tests green, real-device verified.