Repository navigation
Add support for Termux (Android) #52
Description
Activity
Thanks for confirming that Crabcode can run on Termux with the initial workaround.
At the moment, Android/Termux is still experimental and unsupported in the current release train. The focused compatibility work addresses the build blocker from
arboardand makes the remote client runnable with Node/npm.Image attachments are not supported on Android yet.
arboardhas no Android clipboard-image backend, so image paste needs a dedicated Android/Termux implementation rather than just disabling the dependency. Until that exists, the intended behavior is a clear unsupported-feature error instead of a failed build.We should treat a successful Termux launch as encouraging validation, not a support guarantee, until the Android build and runtime paths are covered by CI and documented.
Thanks for confirming that Crabcode can run on Termux with the initial workaround.
At the moment, Android/Termux is still experimental and unsupported in the current release train. The focused compatibility work addresses the build blocker from
arboardand makes the remote client runnable with Node/npm.Image attachments are not supported on Android yet.
arboardhas no Android clipboard-image backend, so image paste needs a dedicated Android/Termux implementation rather than just disabling the dependency. Until that exists, the intended behavior is a clear unsupported-feature error instead of a failed build.We should treat a successful Termux launch as encouraging validation, not a support guarantee, until the Android build and runtime paths are covered by CI and documented.
I asked GPT, and it said we can use Termux:API for the clipboard.
And here is an example of how to build CrabCode in GitHub Actions using a Termux Docker image:
name: "Release (arm64: Termux)" on: push: branches: [main] tags: ["v*"] pull_request: workflow_dispatch: permissions: contents: read jobs: create-release: runs-on: ubuntu-26.04-arm permissions: contents: write steps: - name: Create / update GitHub Release if: startsWith(github.ref, 'refs/tags/v') uses: softprops/action-gh-release@v2 with: generate_release_notes: true build-termux: name: Build Termux (aarch64, bionic) needs: create-release if: github.event_name != 'pull_request' runs-on: ubuntu-26.04-arm permissions: contents: write steps: - name: Checkout uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: Install Bun uses: oven-sh/setup-bun@v2 - name: Build remote client shell: bash run: | cd remote-client bun install --frozen-lockfile bun run build - name: Verify remote client assets shell: bash run: test -s remote-client/dist/client/index.html - name: Pull termux-docker image run: docker pull termux/termux-docker:aarch64 - name: Prepare host dist folder run: | mkdir -p "${{ github.workspace }}/dist" chmod -R 777 "${{ github.workspace }}/dist" - name: Build crabcode natively inside Termux run: | docker run --rm \ -v "${{ github.workspace }}:/workspace:ro" \ -v "${{ github.workspace }}/dist:/dist" \ termux/termux-docker:aarch64 \ bash -lc ' set -euo pipefail PREFIX=/data/data/com.termux/files/usr rm -f "$PREFIX/etc/apt/sources.list.d/termux.sources" printf "deb https://packages.termux.dev/apt/termux-main stable main\n" > "$PREFIX/etc/apt/sources.list" for i in 1 2 3; do apt update -y && break || sleep 5; done for i in 1 2 3; do apt upgrade -y && break || sleep 5; done apt install -y rust binutils pkg-config clang make openssl rustc --version cargo --version cd /workspace CARGO_TARGET_DIR=/dist/target cargo build --release --locked mv /dist/target/release/crabcode /dist/crabcode-termux-aarch64 ' - name: Upload to GitHub Release if: startsWith(github.ref, 'refs/tags/v') env: GH_TOKEN: ${{ github.token }} run: gh release upload "$GITHUB_REF_NAME" dist/crabcode-termux-aarch64 --clobberI tried this PRin my private repo, it builds successfully in Termux.


Check if target os is Android disable arboard
remote-client also needa an adjustment to use nodejs instead of bun