install: required device argument + --device=watch watch installs
- Commit
b52566fee6c850e49cfa1e0f23e8cc4fe67a8903- Author
- Vayun Mathur <[email protected]>
- When
- 2026-12-04 19:07 UTC (1 day ago)
- Parents
e8e1b7d
The device is now a required argument (8, 9, or --device=watch); there is no default/first-device guessing. --device=watch selects the Pixel Watch by model in adb devices -l and session-installs the same single APKs, which carry their watch experience via FEATURE_WATCH routing. Verified: bash -n clean; ./install --dry-run clock without a device exits 1 with the required-device error; --device=watch dry-run selects the watch target.
Diff
AGENTS.md
diff --git a/AGENTS.md b/AGENTS.mdindex 3ae0142ca7..e69c79b7b5 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -98,14 +98,14 @@ Work in repo dir. Experiments/logs go in `analysis/` (gitignored). `./install` — build + session-install (handles `.idsig`/fs-verity + `versionCodeOverride` automatically): ```-./install <module> [...] # release by default-./install [dev|release] <module> [...]+./install <device> <module> [...] # release by default; device (8|9|--device=watch) is required+./install [dev|release] <device> <module> [...] ./install voxels # shorthand → games:voxels; dooraccess → personal:dooraccess ./install dev games/voxels # slash == colon-./install contacts calendar # multi-module, one gradlew invocation-./install 9 maps # 8 = Pixel 8, 9 = Pixel 9 (default: first non-emulator)-./install all / ./install release all # full repo (auto big-heap); release all caps R8 workers-./install --dry-run contacts+./install 9 contacts calendar # multi-module, one gradlew invocation+./install 9 maps # device required: 8 = Pixel 8, 9 = Pixel 9, --device=watch = Pixel Watch+./install 9 all / ./install release 9 all # full repo (auto big-heap); release all caps R8 workers+./install --dry-run 9 contacts ``` Rules: `release` default (dev is almost never the right install), `dev` only when asked, `debug` blocked. Never uninstall / clear data (emulator-only exception, never touch physical device). Never give placeholder commands — output copy-pasteable.
install
diff --git a/install b/installindex f2349a0752..307a4e81e3 100755--- a/install+++ b/install@@ -7,11 +7,12 @@ ROOT="$SCRIPT_DIR" print_help() { cat <<'EOF' Usage:- ./install [dev|release] <module> [module...]- ./install <module> [module...] # defaults to release- ./install [dev|release] all # installs all app modules- ./install all # same, defaults to release+ ./install [dev|release] <device> <module> [module...]+ ./install <device> <module> [module...] # defaults to release+ ./install [dev|release] <device> all # installs all app modules+ ./install <device> all # same, defaults to release ./install [dev|release] [8|9] <module> # Pixel 8 or Pixel 9 (by model)+ ./install --device=watch <module> # Pixel Watch (by model; merged single-APK apps install their watch experience) Description: Ergonomic wrapper around ./gradlew :module:assembleRelease + adb session install.@@ -22,8 +23,10 @@ Description: - Supports personal shorthand: ./install dooraccess -> personal:dooraccess (auto-prefixed if personal/<name> is a personal app) - Supports "all" keyword: ./install all -> installs every app module - Supports multiple modules in one call (single gradlew invocation)- - 8|9 selects the Pixel 8 or Pixel 9 by model (optional; defaults to the- first non-emulator device). Also accepts --device 8|9 / --device=8|9.+ - The device argument is REQUIRED: 8|9 selects the Pixel 8 or Pixel 9 by+ model, --device=watch selects the Pixel Watch by model (only merged+ single-APK apps and :watch:wear make sense there). Also accepts+ --device 8|9 / --device=8|9. There is no default device. - Installs via adb package sessions with the .idsig sidecar staged, so updates to preinstalled MAOS system apps get fs-verity (plain installDev/installRelease and `adb install` never stage it and always fail@@ -186,7 +189,7 @@ while [[ $idx -lt ${#FILTERED_ARGS[@]} ]]; do lc="$(echo "$arg" | tr '[:upper:]' '[:lower:]')" if [[ "$lc" == "--device" ]]; then if [[ $((idx + 1)) -ge ${#FILTERED_ARGS[@]} ]]; then- echo "Error: --device requires a value: 8 (Pixel 8) or 9 (Pixel 9)."+ echo "Error: --device requires a value: 8 (Pixel 8), 9 (Pixel 9) or watch (Pixel Watch)." exit 1 fi DEVICE_HINT="$(echo "${FILTERED_ARGS[$((idx + 1))]}" | tr '[:upper:]' '[:lower:]')"@@ -201,15 +204,19 @@ while [[ $idx -lt ${#FILTERED_ARGS[@]} ]]; do idx=$((idx + 1)) continue elif [[ "$lc" =~ ^[0-9]+$ ]]; then- echo "Error: Invalid device '$arg'. Use 8 (Pixel 8) or 9 (Pixel 9)."+ echo "Error: Invalid device '$arg'. Use 8 (Pixel 8), 9 (Pixel 9) or --device=watch." exit 1 fi PRESCAN_ARGS+=("$arg") idx=$((idx + 1)) done FILTERED_ARGS=("${PRESCAN_ARGS[@]}")-if [[ -n "$DEVICE_HINT" && "$DEVICE_HINT" != "8" && "$DEVICE_HINT" != "9" ]]; then- echo "Error: Invalid device '$DEVICE_HINT'. Use 8 (Pixel 8) or 9 (Pixel 9)."+if [[ -n "$DEVICE_HINT" && "$DEVICE_HINT" != "8" && "$DEVICE_HINT" != "9" && "$DEVICE_HINT" != "watch" ]]; then+ echo "Error: Invalid device '$DEVICE_HINT'. Use 8 (Pixel 8), 9 (Pixel 9) or watch (Pixel Watch)."+ exit 1+fi+if [[ -z "$DEVICE_HINT" ]]; then+ echo "Error: a target device is required: pass 8 (Pixel 8), 9 (Pixel 9) or --device=watch (Pixel Watch); there is no default device." exit 1 fi @@ -457,6 +464,10 @@ if [[ -n "$ADB_BIN" ]]; then TARGET_SERIAL="$dev_serial" break fi+ if [[ "$DEVICE_HINT" == "watch" && "$dev_model" == *Watch* ]]; then+ TARGET_SERIAL="$dev_serial"+ break+ fi done < <("$ADB_BIN" devices -l 2>/dev/null) fi @@ -476,7 +487,7 @@ elif [[ -n "$TARGET_SERIAL" ]]; then echo "Target device: $ANDROID_SERIAL (first connected device not starting with 'emulator')" fi elif [[ -n "$DEVICE_HINT" ]]; then- echo "Error: No connected Pixel $DEVICE_HINT found (check 'adb devices')."+ echo "Error: No connected device matching '$DEVICE_HINT' found (check 'adb devices')." exit 1 elif [[ $DRY_RUN -eq 1 ]]; then echo "[DRY-RUN] Warning: no non-emulator device connected; ANDROID_SERIAL not set."