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>
This commit is contained in:
shenlei
2026-09-30 16:36:21 +09:00
co-authored by Claude Opus 5.5
parent f9cd63713f
commit cd9e5b259d
10 changed files with 363 additions and 64 deletions
@@ -76,7 +76,7 @@ The 106 `project/*_system.gd` files that only their own `test_*_parity.gd` loade
cmake -S . -B build/native -DCMAKE_BUILD_TYPE=Release -DMT_BUILD_NATIVE_RENDER=ON -DCMAKE_PREFIX_PATH=/opt/homebrew
cmake --build build/native -j8 && ctest --test-dir build/native --output-on-failure -j4
./scripts/port_gate.sh macos android # build/port-gate
./android/build.sh Release --install # build/android + APK
./android/build.sh Release # build/android + APK; installs + syncs zh assets when a phone is attached
```
All build trees live under `build/` (gitignored). Always finish with `git diff --check`.