Say which emulator, now that this checkout has its own

`run-android.sh` derives its AVD from the checkout, so two clones of this
repo run two emulators, and with both attached a bare `adb` call stops
working. The failures do not say so: `adb shell` and `adb get-state` fail
with `more than one device/emulator`, and `adb shell pm list packages`
comes back empty -- which reads as the app having been uninstalled, and
sent dev-updater's session looking for a wipe that had not happened. Its
enrolment script mis-diagnosed the same ambiguity as "no emulator is
running", whose advice is to start a third.

The enrolment line in this file was itself a bare `adb shell`, so it was
the instruction that would have produced the confusion.
This commit is contained in:
iris committed 2026-08-30 00:17:38 -04:00
1 parent 2f4dff1435
commit 5616ed8aba
1 file changed
+11 -1
+11 -1
View File
@@ -214,8 +214,18 @@ first if a remote spawn ever mangles an argument.
`$XDG_CONFIG_HOME` (`~/.config` when that is unset), never in the `$XDG_CONFIG_HOME` (`~/.config` when that is unset), never in the
checkout, so a relative `certs/ca.pem` finds nothing. checkout, so a relative `certs/ca.pem` finds nothing.
The emulator app reaches it at `https://10.0.2.2:8443`; enroll it with The emulator app reaches it at `https://10.0.2.2:8443`; enroll it with
`adb shell "am start -a android.intent.action.VIEW -d 'aiapp://enroll?host=10.0.2.2&port=8443&token=…'"` `adb -s "$SERIAL" shell "am start -a android.intent.action.VIEW -d 'aiapp://enroll?host=10.0.2.2&port=8443&token=…'"`
(quote so the device shell doesn't eat the `&`s). (quote so the device shell doesn't eat the `&`s).
- **Name the device on every `adb` call.** This checkout runs its own
emulator — `run-android.sh` derives the AVD name from the directory, so
a second clone gets a second AVD rather than queueing for one shared
machine-wide `tdep`. With more than one attached, a bare `adb shell` or
`adb get-state` fails with `more than one device/emulator` and a bare
`adb shell pm list packages` comes back **empty**, which reads as the app
having been uninstalled rather than as the question being ambiguous.
Get the serial the way `run-android.sh` does — match `adb -s <serial> emu
avd name` against the AVD — or export `ANDROID_SERIAL`, which every
`adb` call honours without `-s`.
## Where things run (host vs this VM) ## Where things run (host vs this VM)