- Physical Android phone (emulators do not support Android Auto)
- Android SDK installed (
$ANDROID_HOMEset to~/Library/Android/sdk) - ADB connected to your phone (USB or WiFi)
On your phone, open the Android Auto app:
- Tap the version number in the footer 10 times
- Go to Developer Settings → enable Unknown sources
Add to ~/.zshrc:
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-toolsThen reload: source ~/.zshrc
./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apkIn the Android Auto app: tap the three-dot menu → Head Unit Server
adb forward tcp:5277 tcp:5277If connected via WiFi, specify the device ID:
adb -s <device-id> forward tcp:5277 tcp:5277Your device ID can be found via
adb devices.
$ANDROID_HOME/extras/google/auto/desktop-head-unitAlerts must fire while AutoSugar is not the visible car app — that is the whole point of them, and it is the one thing the DHU makes easy to get wrong, because the app is on screen the entire time you are looking at it.
-
Open AutoSugar on the DHU once, with at least one alert-enabled profile. This is what starts
GlucoseMonitorService; confirm it is running:adb shell dumpsys activity services de.autosugar | grep -i "GlucoseMonitorService\|isForeground"
A silent "Monitoring glucose" notification also appears on the phone.
-
Switch the DHU to another app (Maps, or the launcher) so AutoSugar leaves the screen. The service must stay in the list above — it is no longer tied to the session.
-
Drive the reading past a threshold (point the profile at a test Nightscout instance, or lower
bgHighin Nightscout) and confirm the alert still appears as a heads-up notification on the car screen while another app is in the foreground. -
Disconnect the head unit (quit the DHU, unplug the phone). The service must stop within a few seconds — re-run the
dumpsyscommand and confirm it is gone, along with the phone notification.
Note that Android 15+ caps a dataSync foreground service at six hours per 24-hour window. On
timeout the app posts a "glucose monitoring stopped" alert and stops the service; reopening
AutoSugar on the car screen starts it again.