# Store assets without devices, offline-media hosting, and test builds ## Flutter: store screenshots and screen videos without an emulator/simulator Default for Flutter apps (user decision): do not boot an emulator just to capture store media. 1. In `flutter test` (or an `integration_test` run on the host), pump the real app with real data at the target logical size × devicePixelRatio (Play phone 1080×2400 @ 2.625; tablets 7"/10"; iPhone/iPad sizes from the current official spec). 2. Load real fonts (`FontLoader` for the app font + Roboto/SF substitutes) — otherwise the test renderer draws Ahem boxes. Serve map tiles from a cache or a fixed image; no network in tests. 3. Screenshot: wrap the app in a `RepaintBoundary`, `toImage(pixelRatio: dpr)` → PNG. 4. Video: script the scenario (scroll, tap, route change) and advance with `tester.pump(const Duration(milliseconds: 33))`, capturing one PNG per pump; then `ffmpeg -framerate 30 -i f%05d.png -c:v libx264 -pix_fmt yuv420p out.mp4`. Make TR and EN runs from the same script by switching the app locale. 5. Add an OS status bar/device frame afterwards in the marketing composition if wanted. 6. Document the commands in the repo (`tool/magaza/README.md`) so other Flutter projects reuse the path. Run heavy steps (ffmpeg, builds) under a shared machine-wide lock if your setup has one: `lockf `. ## Keeping embedded photos out of the binary (free hosting options) Measure the real processed set first (count × average KB). Options, best first: | Option | Free limits (verify current docs) | Notes | |---|---|---| | Cloudflare Pages | 20,000 files/site, 25 MiB/file, no bandwidth cap, no card | fits ~9k photos + ~9k thumbs; stable per-file URLs | | GitHub Pages / jsDelivr | ~1 GB site, ~100 GB/month soft | simplest; may outgrow traffic | | Play Asset Delivery / iOS On-Demand Resources | store-hosted | no server, but native code per platform in Flutter | Avoid for "free": R2 (needs a payment method), Firebase (360 MB/day transfer), hot-linking the source site (load + dependency on them). Recommended shape: small thumbnails embedded (offline lists/maps work), full-size fetched on open and cached, optional "download this place/area" pack for offline trips. Re-hosting third-party photos is redistribution either way — keep watermark + attribution and suggest written permission from the source. ## Delivering a test build to the user's phone - Build `flutter build apk --release --target-platform android-arm64` (one ABI, one mode; `--split-per-abi` is unnecessary with a single target). Do not switch phone test builds to debug to save space: debug adds a second build mode to `build/` and runs slow on the device. Without `key.properties` it is debug-signed: installable by sideload, not uploadable to Play; say so, and warn that an older install with a different signature must be removed first. - Verify before sending: `aapt2 dump badging` (package, version), `apksigner verify --print-certs` (which key), count of bundled assets. - Telegram bots cannot send files > 50 MB. Serve over the tailnet instead: copy the APK to a dedicated folder, `python3 -m http.server --bind 127.0.0.1` there (check the port with `lsof -nP -iTCP: -sTCP:LISTEN` first — another agent's server may already own it and you would publish the wrong site), then `tailscale serve --bg --https= http://127.0.0.1:`. (The macOS App Store Tailscale build cannot serve a filesystem path directly; proxying a local server works.) Prove it by downloading through the tailnet URL and comparing SHA-256 with the original.