diff --git a/AGENTS.md b/AGENTS.md index 8f069f4..c72e106 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -258,11 +258,12 @@ first if a remote spawn ever mangles an argument. `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). - **The emulator is `~/repos/emulator-tools`' business, not this repo's.** - `emu up` creates and boots the AVD named after this checkout (`ai-app-2`), - refusing when the machine has no room for one; `emu list` says what is - attached and what it costs; `emu down` stops it. `run-android.sh` is that - plus a build and an install. Run that repo's `install.sh` once if `emu` is - missing. + `emu up` creates and boots the AVD named after this checkout — whatever + `emu name` prints, never a name typed out here, since this file is the same + in every clone — refusing when the machine has no room for one; `emu list` + says what is attached and what it costs; `emu down` stops it. + `run-android.sh` is that plus a build and an install. Run that repo's + `install.sh` once if `emu` is missing. The `adb` on `PATH` after sourcing `android-env.sh` is that repo's wrapper, which fills in `-s` from the same rule — so a bare `adb shell` reaches this checkout's emulator and refuses to reach another one's. That defaulting is @@ -270,6 +271,16 @@ first if a remote spawn ever mangles an argument. and no `-s`, 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. + **Gradle does not go through that wrapper**, so it had the same hole until + 2026-08-31: `installDebug`, `uninstallDebug` and `connectedAndroidTest` ask + the adb server for every attached device and act on all of them, which is + how one session's debug build landed on another's emulator. A Gradle init + script from `emulator-tools` now runs `emu check` before those tasks and + fails the build rather than fanning out. When it refuses, say which device + you mean at the moment you use it — `ANDROID_SERIAL=$(emu serial) + ./gradlew …` — rather than exporting a serial into the shell, which goes + stale the next time an emulator restarts and another checkout's takes the + port. ## Where things run (host vs this VM)