Remote Access

2 minute read

How I really use this machine.

Now I’m past the novelty of plugging in monitors this is how I actually use the machine.

Remote builds over SSH

I’m working on an Android tablet most of the time, using Termux, Proot-distro and Termux/X11 to run Debian Bookworm arm64. This setup has shortcomings but I find it very comfortable and manage to get 90% of my work done on it.

One current problem is that the arm64 version of the Android SDK can’t build arm64 APKs for Android. During main development I just build/run the Linux version of whichever app I’m working on — Flutter is multi-platform and suprisingly consistent between platforms. But of course I need to build APKs for Android devices at some point.

When I just need to quickly build some APKs for a given project, I use something like the following script (this one is for auDAV, my WebDAV audiobook player app):

#!/bin/sh

# Script to be run from Termux/proot-distro
# - Connects to build machine AIR (host defined in `~/.ssh/config`)
# - Logs in to working directory
# - Builds APKs
# - Syncs APKs to local machine


remote_commands=$(cat << 'EOF'
echo "~~~~~~~ Remote: Source local environment ~~~~~~~"
source ~/.zprofile
source ~/.zshrc

echo "~~~~~~~ Remote: Change working directory ~~~~~~~"
cd ~/development/audav

echo "~~~~~~~~~ Remote: Pull latest from git ~~~~~~~~~"
git pull

echo -e "\n~~~~~~~~~~~~~~ Remote: Build APKs ~~~~~~~~~~~~~~"
flutter build apk --split-per-abi
EOF
)

ssh AIR "bash --login -c '${remote_commands}'"

echo "\n~~~~~~~~~~~ Local: Sync APKs to local ~~~~~~~~~~"

rsync -r --mkpath --progress AIR:development/audav/build/app/outputs/flutter-apk $HOME/000-WORK/audav/build/app/outputs/

Fromhttps://codeberg.org/mm-dev/shell-scripts/raw/branch/termux-proot-ubuntu/audav-build-on-mac

Full remote graphical access with NoMachine

To build apps for MacOS, iOS and iPadOS I must endure the torturous window management, tedious animations, and terrible file manager of MacOS (and that’s before we even get to XCode).

To ease my suffering I can at least use MacOS via the OLED screen of a Galaxy Tab S8 Ultra, a DEFT PRO trackball and a Ferris Sweep split mechanical keyboard.

NoMachine works well for remoting into MacOS and over the LAN it performs well with very little lag. There’s client software for Android and arm64 Linux meaning it’s quick and easy for me to just pop in to MacOS from my favoured Linux/DWM environment.