Files
photo-live/apps/mobile
浅念 fb3c278e50 test(mobile): integration suite against real backend on mumu
P3 Task 11 (WRITE & COMPILE phase; device run pending MuMu availability).

- integration_test/p3_flow_test.dart: login -> album (zh+en) -> category
  -> invite -> enqueue 3 real JPEGs -> queue completed -> server history
  (sourceDeviceId) -> ov public API sees 3 -> hide via API + UI sync ->
  DIO fault-gate offline (waitingNetwork -> retry -> 4 completed) ->
  password change (session kept) -> relogin -> in-app locale smoke.
- integration_test/p3_background_test.dart: IT_PHASE=prepare/verify spec
  for HOME-background continuation and force-stop kill-restart recovery
  (2 x ~14MB noise JPEGs give a deterministic mid-flight window).
- helpers: dart-define config, fault-injecting DIO adapter, app harness
  (picker/notification/locale provider overrides), UI step library with
  live-binding polling (no pumpAndSettle).
- scripts/run-mobile-it.sh: device detect (exit 2), backend ensure
  (compose + api/ov/worker/sync, exit 3), idempotent per-run user seed
  (no DB reset), APK build/install + adb push of testdata, phase 1 /
  --background phase 2 orchestration with server-side confirmed-count
  truth via curl.
- services/api seed:it script (create-if-absent staff accounts).
- debug-only network security config: cleartext HTTP permitted to
  10.0.2.2/127.0.0.1/localhost only (release unaffected).
- testdata: 3 x ~120KB + 2 x ~14MB generated JPEGs.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-19 05:35:16 +08:00
..
2026-09-19 05:00:11 +08:00

photo_live(工作人员 App)

P3 Flutter App(Android 优先;iOS 目录已生成但本机不编译,见计划 G3 关口)。

环境

工具链不在 PATH,所有 Flutter/Dart 命令先 source 仓库根的环境脚本(Git Bash):

source scripts/flutter-env.sh   # 仓库根执行;含 PATH/JAVA_HOME/ANDROID_HOME 与国内 pub 镜像

常用命令

cd apps/mobile
flutter pub get        # 依赖
flutter gen-l10n       # l10n 生成(arb 在 lib/l10n/,模板 app_zh.arb)
flutter analyze        # 静态检查(要求 0 issue)
flutter test           # 单测 / widget 测试
flutter build apk --debug   # 产物 build/app/outputs/flutter-apk/app-debug.apk

MuMu 模拟器联调:

adb connect 127.0.0.1:16384   # 失败再试 5555 / 7555 / 21503
adb devices
adb install -r build/app/outputs/flutter-apk/app-debug.apk
adb shell am start -n com.photolive.photo_live/.MainActivity

结构

  • lib/app/:根组件、主题(Material 3)、locale provider 脚手架(Task 10 完成切换)
  • lib/pages/:login / home(相册、队列、设置三个 tab 的桩页面)
  • lib/l10n/:arb 与生成的 app_localizations*.dart(zh 模板 + en)
  • Android:minSdk 24 / targetSdk 36;INTERNET 权限在 main manifest(debug+release 生效)
  • iOS:Info.plist 含本地网络 ATS 例外(联调宿主回环;Android 侧对应 10.0.2.2)与相册/相机用途说明(zh+en)

说明

  • sqlite3_flutter_libs 解析到 0.6.0+eol(官方弃用桩:sqlite3 3.x 起经 Dart 原生构建钩子自带 SQLite,无需该包);Task 5 建 drift schema 时在模拟器上验证实际打包行为。
  • turbo/pnpm 天然不纳入本目录(无 package.json);移动端命令以上述手动方式执行。