avd: Add script to run command on all emulators

This CL adds `run_per_emulator.py`, a tool designed to iterate
through all available AVD configurations, start each one individually,
run a user-specified command, and then stop the emulator.

It filters out old API levels (<= 28) by default and can optionally
write the command output for each emulator to a specified file.

This simplifies bulk testing or data collection across different AVDs.

For example, this command can view all the product models at once:
$ tools/android/avd/run_per_emulator.py --all \
  --cmd 'adb shell getprop ro.product.model'

[email protected]

Bug: 447426658
Change-Id: I7fa097d2bed84d924723452930583e7ea2b6fd40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7068372
Reviewed-by: Andrew Grieve <[email protected]>
Commit-Queue: Peter Wen <[email protected]>
Auto-Submit: Peter Wen <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1533039}
NOKEYCHECK=True
GitOrigin-RevId: 0d35a185985b3329e9da1a4c768ca1045e2f6094
2 files changed