Runbook
Read For agents for the safety rules first. Each step: Do, Verify (expected output below it), If it fails. “contains” means a substring match is enough. Stop and ask the user whenever a step says Ask user.
export GLASS_APK="$HOME/Downloads/glass-tv-launcher.apk"With more than one device, add -s SERIAL to every adb command.
Install + one command
Section titled “Install + one command”1. Reach the stick
Section titled “1. Reach the stick”adb get-statedeviceIf it fails: unauthorized means Ask user to accept the prompt on the TV. No device means ask for the stick’s IP, then adb connect STICK_IP:5555.
2. Check the model
Section titled “2. Check the model”adb shell getprop ro.product.devicekaratIf it fails: another value is an untested device. Ask user before continuing. Never run the rooted or full system install on it.
3. Install the APK
Section titled “3. Install the APK”Ask user to approve.
test -f "$GLASS_APK" && adb install -r "$GLASS_APK"SuccessVerify:
adb shell pm list packages dev.glasslauncherpackage:dev.glasslauncherIf it fails: adb uninstall dev.glasslauncher, then stop.
4. Note the current home
Section titled “4. Note the current home”adb shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOMElast line names the current home, normally com.amazon.tv.launcher/...Write it down as the “before” value.
5. Make Glass the home screen
Section titled “5. Make Glass the home screen”Ask user to approve disabling Amazon’s launcher.
adb shell pm disable-user --user 0 com.amazon.tv.launchercontains: new state: disabled-userVerify:
adb shell cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOMElast line starts with: dev.glasslauncher/If it fails: adb shell pm enable com.amazon.tv.launcher, then stop.
6. Home reaches Glass
Section titled “6. Home reaches Glass”adb shell input keyevent KEYCODE_HOMEadb shell dumpsys activity activities | grep -m1 topResumedActivitycontains: dev.glasslauncherIf it fails: roll back as in step 5, then stop.
7. Optional grants
Section titled “7. Optional grants”Ask user which of these they want. Run only those.
adb shell pm grant dev.glasslauncher android.permission.WRITE_SECURE_SETTINGSadb shell appops set dev.glasslauncher GET_USAGE_STATS allowadb shell pm grant dev.glasslauncher android.permission.ACCESS_FINE_LOCATIONVerify:
adb shell dumpsys package dev.glasslauncher | grep -E "WRITE_SECURE_SETTINGS|ACCESS_FINE_LOCATION"adb shell appops get dev.glasslauncher GET_USAGE_STATSeach granted permission line contains: granted=trueGET_USAGE_STATS: allowIf it fails: adb shell pm revoke dev.glasslauncher android.permission.WRITE_SECURE_SETTINGS (same for the others), then stop.
Rooted install (root only)
Section titled “Rooted install (root only)”R1. Root works (Root only)
Section titled “R1. Root works (Root only)”Ask user to accept the Magisk prompt on the TV.
adb shell su -c idcontains: uid=0(root)If it fails: stop. Skip every root-only step.
R2. Magisk is present (Root only)
Section titled “R2. Magisk is present (Root only)”adb shell su -c "magisk -c"a non-empty version string, for example 30.7:MAGISKSUIf it fails: stop.
R3. Install the Glass Pro modules (Root only)
Section titled “R3. Install the Glass Pro modules (Root only)”Untested: these steps have not been run end to end on a stick yet; stop and report at the first unexpected output.
Ask user to approve the install and each reboot. Run from the root of the Glass source repository.
scripts/buildscripts/remote-keys installscripts/remote-keepalive installscripts/tuning install --rebootadb wait-for-deviceVerify after the stick has booted:
adb shell su -c "ls /data/adb/modules"scripts/remote-keys statusscripts/remote-keepalive statusscripts/tuning statusmodules contains: glass-system glass-remote-keys glass-remote-keepalive glass-tuningkeepalive status: module: installedtuning status: module installedIf it fails: adb wait-for-device shell su -c "magisk --remove-modules", then stop. If adb never returns, Ask user: a custom recovery is needed. To remove one module, run its uninstall command and restart.
Full system install
Section titled “Full system install”Coming soon. Do not attempt.