-
Download ConnectIQ SDK and add bin directory to your PATH. For that you can put the following to your .bashrc or the like:
CONNECT_IQ_BASE="<installation-dir>" CONNECT_IQ=`cat "$CONNECT_IQ_BASE/current-sdk.cfg"` PATH="$PATH:$CONNECT_IQ/bin"
For example, on MacOS yo say:
CONNECT_IQ_BASE="$HOME/Library/Application Support/Garmin/ConnectIQ/"
-
Make sure you have xmlstarlet installed.
-
Generate a private developer key (4096 RSA), for example here and put it to
$HOME/StudioProjects/developer_key
. Or runopenssl genrsa -out $HOME/StudioProjects/developer_key
You can also put the file somewhere else and point DEVELOPER_KEY to the location.
-
Start the Android virtual device on AndroidStudio and run AAPS in simulator or connect your phone via AndroidStudio debugging. In AAPS -> Config Builder enable "Garmin". If you're using the simulator, also enable "Random BG" as BG source.
-
Run
./adb-forward.sh
(if you have multiple devices, e.g. simulator and phone, you need to specify to which you want to connect. Runadb devices
to get the device id and then./adb-forward -s <deviceid>
) -
Run
make GlucoseWatchFace/run
-
To run on a different device, set the device environment variable:
export device=fenix6
or dodevice=fenix6 make GlucoseWatchFace/run
-
If you don't get values, make sure Settings -> Use device HTTPS requirements is off. Then execute Simulation -> Background Events -> Temporal Event. You can always force the app the retrieve new values with this command.
- Run
make test
to run unit tests.
To test on your device, you need to build the .prg file. For example to build the watch face for fenix6:
device=fenix6 make bin-fenix6/GlucoseWatchFace.prg
Then copy the file to the Garmin/GARMIN/APPS directory on the device. To access the file system on watches, you probably need to install the Android File Transfer tool. Also create an empty file Garmin/GARMIN/APPS/logs/GlucoseWatchFace.log to get log output.