#!/usr/bin/env bash # Cold-start measurement: time to first frame plus the in-app boot log. # # `am start -W` measures until the activity is idle. That number is polluted by # the Google UMP consent form (a second window), so run this only *after* # consent has been given once - otherwise TotalTime includes the dialog. # # Usage: tools/device/startup.sh [runs] (default 3) set -euo pipefail ADB=${ADB:-adb} PKG=${PKG:-de.softwareapp_hb.ironarc} ACT=${ACT:-.MainActivity} RUNS=${1:-3} echo "## Kaltstart ($RUNS Laeufe, $PKG)" for i in $(seq 1 "$RUNS"); do $ADB shell am force-stop "$PKG" sleep 2 $ADB logcat -c total=$($ADB shell am start -W -n "$PKG/$ACT" 2>/dev/null \ | tr -d '\r' | awk '/TotalTime/ {print $2}') sleep 2 ready=$($ADB logcat -d 2>/dev/null | tr -d '\r' \ | grep -oE 'iron_arc: ready after [0-9]+ ms' | tail -1) echo " Lauf $i: TotalTime ${total:-?} ms | ${ready:-kein Bootlog (Release ohne Log?)}" done echo echo "Richtwerte (Redmi Note 10, Android 12): Debug ~3050 ms, Profile/AOT ~2040 ms." echo "Splash-Kette: nativer Splash -> Flutter-Splash (Puls, min. 700 ms) -> Fade in die Partie."