install-tv.sh: NO_LAUNCH=1 installs without bringing Orbit to the front

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 22:06:56 +00:00
co-authored by Claude Opus 5.5
parent 79f2c03022
commit fb09b9a492
+3 -3
View File
@@ -31,13 +31,13 @@ if [ "${DRY_RUN:-0}" = "1" ]; then python3 "$TOOLS/compare_snapshots.py" "$B/bef
$R --es do rollback --es version "$(echo "$PREV" | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+')" | grep -o 'data="[^"]*"'
$A -s $D install -r "$APKS/orbit-tv-$NEW.apk" | tail -1 || exit 1
$A -s $D shell cmd package compile -m speed -f tv.orbit.classic >/dev/null
$A -s $D shell am start -n tv.orbit.classic/.MainActivity >/dev/null
sleep 25
# NO_LAUNCH=1 leaves whatever is on screen alone (17 November 2026: another app was playing in the living room).
if [ "${NO_LAUNCH:-0}" != "1" ]; then $A -s $D shell am start -n tv.orbit.classic/.MainActivity >/dev/null; sleep 25; else sleep 3; fi
NOW=$($A -s $D shell dumpsys package tv.orbit.classic | grep -m1 versionName | sed 's/.*versionName=//' | tr -d '\r ')
COPIES=$($A -s $D shell "dumpsys activity activities | grep -c 'Hist.*tv.orbit.classic/.MainActivity'" | tr -d '\r')
echo "now $NOW, copies of Orbit running: $COPIES"
snap after
python3 "$TOOLS/compare_snapshots.py" "$B/before" "$B/after"; RESULT=$?
ls -d "$OT/backups/${PFX}install-"* 2>/dev/null | sort | head -n -3 | xargs -r rm -rf
[ "$NOW" = "$NEW" ] && [ "$COPIES" = "1" ] && [ $RESULT -eq 0 ] && { echo "Install checked out."; exit 0; }
[ "$NOW" = "$NEW" ] && { [ "$COPIES" = "1" ] || [ "${NO_LAUNCH:-0}" = "1" ]; } && [ $RESULT -eq 0 ] && { echo "Install checked out."; exit 0; }
echo "Install needs a look (version $NOW, copies $COPIES, comparison exit $RESULT)."; exit 3