From 3605f4e081283b2f32451c7075fe07648e76e99d Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 22 Oct 2026 11:08:09 +0200 Subject: Add Android project skeleton and Docker build Co-Authored-By: Claude Opus 5.5 --- deploy.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 deploy.sh (limited to 'deploy.sh') diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..41d546d --- /dev/null +++ b/deploy.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# deploy.sh: build the APK, install it on the TV over wireless adb and +# launch it. Finds the TV through its _adb-tls-connect mDNS record when no +# device is connected; wireless debugging must be on (it turns off on reboot). +# +# Copyright (C) 2026 Danilo M. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. + +set -euo pipefail +cd "$(dirname "$0")" + +pkg=mygram.droid +apk=app/build/outputs/apk/debug/mygram-droid-debug.apk + +if ! adb get-state >/dev/null 2>&1; then + addr=$(avahi-browse -rtp _adb-tls-connect._tcp 2>/dev/null | + awk -F';' '/^=/ && $3 == "IPv4" {print $8 ":" $9; exit}') + [ -n "$addr" ] || { echo "no device: set ANDROID_SERIAL or enable wireless debugging" >&2; exit 1; } + adb connect "$addr" >/dev/null + export ANDROID_SERIAL=$addr +fi + +./build.sh +adb install -r "$apk" +adb shell -n am start -n "$pkg/.MainActivity" >/dev/null +echo "deployed to ${ANDROID_SERIAL:-$(adb get-serialno)}" -- cgit v1.2.3