diff --git a/examples/folio/justfile b/examples/folio/justfile index fcfc615..82d0502 100644 --- a/examples/folio/justfile +++ b/examples/folio/justfile @@ -79,6 +79,51 @@ _ensure-device: echo "emulator did not finish booting in time (see /tmp/folio-emulator.log)" >&2 exit 1 +# Print the serial every device-affecting recipe must act on, or refuse. A run +# installs the app, clears its state and fuzzes it, so the target is never +# inferred from "whatever adb resolved to": the one case it picks on its own is +# a single emulator on the local adb server, which is cheap to rebuild. +_require-device: + #!/usr/bin/env bash + set -euo pipefail + adb="$(just _android-home)/platform-tools/adb" + listing="$("$adb" devices)" + online="$(echo "$listing" | awk 'NR>1 && $2=="device"{print $1}')" + count="$(printf '%s' "$online" | grep -c . || true)" + + refuse() { + cat >&2 <