Files
mtgodot-poc/android/push-client.sh
T
shenleiandClaude Opus 5.5 cd9e5b259d android: build.sh installs and syncs the game files when a phone is attached
After building the APK, android/build.sh now picks the attached device (ANDROID_SERIAL for several),
installs the APK (reinstalling on a signature mismatch), syncs the zh client into files/Client and, with
--launch, wakes the phone and starts the app. Without a device it only builds.

push-client.sh is now incremental (android/sync_client.py): the device keeps files/Client/.mt_sync
(size, mtime, path of what the last sync wrote), so later syncs send only new and changed files as one
tar streamed through `adb shell -T run-as` (no copy in /data/local/tmp) and delete the ones gone
locally. Only game resources are synced; settings and logs the app writes there are kept. --locale zh
rebuilds build/zh-locale/Client first when its inputs changed. android/adb_env.sh picks adb and falls
back to server port 5038 when :5037 cannot bind.

Verified against a fake adb device: first sync (1.4 GB, byte-identical), no-op resync, changed files,
deletions, locale switch, --full, the install/launch path and the no-device path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 16:36:21 +09:00

15 lines
850 B
Bash
Executable File

#!/usr/bin/env bash
# Sync the 40250 game files into the Android app's private files/ (SDL_GetPrefPath), where src/host looks
# for files/Client/pack/Index. Only files changed since the last sync are sent (android/sync_client.py).
# Needs the debug APK installed (run-as).
# ./android/push-client.sh [--locale XX] [--full] [--dry-run] [CLIENT_DIR]
# --locale XX writes the pushed locale.cfg from CLIENT_DIR/locale_XX.cfg. --locale zh defaults CLIENT_DIR
# to build/zh-locale/Client (scripts/build_zh_locale.py, rebuilt first when its inputs changed).
# --full deletes the synced resources on the device and pushes everything again.
# Symbolic links in CLIENT_DIR (the zh client links the original packs) are copied as their targets.
set -euo pipefail
cd "$(dirname "$0")/.."
. android/adb_env.sh
adb_device
exec python3 android/sync_client.py "$@"