Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.
JavaScript apple-watchbodyweightdockerfitnessfitness-trackergymhealthiosmcpnodejspasskeysprogressive-web-applicationspwareactself-hostedself-hostingvitewebauthnweightliftingworkout-tracker
Gym reminder: address field keeps its width beside Search; emulator proof starts clean, docs on Android's proximity-alert latency
Duarte Santos7d1600caeaa2
diff --git a/docs/MOBILE.md b/docs/MOBILE.mdindex 94fed1145..f8ea73941 100644--- a/docs/MOBILE.md+++ b/docs/MOBILE.md@@ -308,9 +308,14 @@ opens the Start screen (or the running workout).`GymReminderCenter` the location delegate at launch so the event lands. On an iPhone with anApple Watch the notification shows on the watch as usual.-Testing on the Android emulator: add a gym, wait 90 s, `adb emu geo fix <lng> <lat>` somewhere-far away, then inside the radius; the notification arrives within a minute or two-(`scripts/android/gym-reminder-emulator.sh` does exactly that).+Testing on the Android emulator: `scripts/android/gym-reminder-emulator.sh <debug apk>` saves a+gym, moves the phone far away and then inside the radius, and checks the notification, the tap+(lands on `#/workout`) and the no-nag rules. `adb emu geo fix` alone is not enough there: it feeds+the GPS provider, while proximity alerts are fed by the fused provider, so the script replaces that+with a shell test provider (`cmd location providers ...`). Android polls proximity alerts at most+every 30 min on its own (`location_background_throttle_proximity_alert_interval_ms`), faster+whenever other apps get fixes; the script lowers it to 15 s. On a real phone that means the nudge+usually comes within minutes, at worst about half an hour after you walk in.## Prerequisitesdiff --git a/frontend/src/index.css b/frontend/src/index.cssindex e17879c17..c6ba0ceb4 100644--- a/frontend/src/index.css+++ b/frontend/src/index.css@@ -2177,7 +2177,8 @@ button.wl-summary{width:100%;padding:0 0 10px;text-align:start;border-radius:var.gym-pin span{display:block;width:30px;height:30px;border-radius:50% 50% 50% 0;background:var(--acc);transform:rotate(-45deg);box-shadow:0 2px 6px rgba(0,0,0,.35);border:2px solid #fff}.gym-radius{stroke:var(--acc);fill:var(--acc);stroke-width:2}.gym-search{display:flex;gap:8px;align-items:center;padding:8px 12px}-.gym-search>:first-child{flex:1;min-width:0}+.gym-search>.field{flex:1;min-width:0;width:auto}+.gym-search>.btn{flex:none;width:auto;padding-left:16px;padding-right:16px}.gym-field{padding:8px 12px}.gym-field input{width:100%}.gym-radius-row{display:flex;align-items:center;gap:12px;padding:12px 14px}diff --git a/scripts/android/gym-reminder-emulator.sh b/scripts/android/gym-reminder-emulator.shindex c8ea51f84..550c6a453 100755--- a/scripts/android/gym-reminder-emulator.sh+++ b/scripts/android/gym-reminder-emulator.sh@@ -53,6 +53,8 @@ walk_in() { # out, wait out the 90 s arming grace, in; returns after up to 75 s}$ADB install -r -g "$APK" >/dev/null+# A fresh start: an earlier run today would have left "went off today" behind.+$ADB shell pm clear "$PKG" >/dev/nullfor p in ACCESS_FINE_LOCATION ACCESS_COARSE_LOCATION ACCESS_BACKGROUND_LOCATION POST_NOTIFICATIONS; do$ADB shell pm grant "$PKG" "android.permission.$p" 2>/dev/null || truedone@@ -77,8 +79,8 @@ foreground; cdp "location.hash = '#/settings'; location.hash"$ADB shell input keyevent KEYCODE_HOME; sleep 2$ADB shell cmd statusbar expand-notifications; sleep 3$ADB shell uiautomator dump /sdcard/ui.xml >/dev/null-set -- $($ADB shell cat /sdcard/ui.xml | grep -o 'text="Gym spotted"[^>]*bounds="[^"]*"' | head -1 | grep -o 'bounds="[^"]*"' | grep -o '[0-9]*' | tr '\n' ' ')-$ADB shell input tap $(( ($1+$3)/2 )) $(( ($2+$4)/2 )); sleep 8+set -- 0 0 0 0 $($ADB shell cat /sdcard/ui.xml | grep -o 'text="Gym spotted"[^>]*bounds="[^"]*"' | head -1 | grep -o 'bounds="[^"]*"' | grep -o '[0-9]*' | tr '\n' ' ')+shift 4; [ $# -eq 4 ] && $ADB shell input tap $(( ($1+$3)/2 )) $(( ($2+$4)/2 )); sleep 8h=$(cdp "location.hash"); echo " route after the tap: $h"; [ "$h" = '=> "#/workout"' ] || FAIL=1echo " left in the shade: $(count)"