A collection of scripts for building Garmin Connect IQ applications within the Windows terminal.
It's using the SDK version which is configured in the Connect IQ SDK Manager.
{
"scripts": {
"build:debug": "npx -y -p=garmin-scripts build --debug",
"build:beta": "npx -y -p=garmin-scripts build --beta",
"build:release": "npx -y -p=garmin-scripts build --release",
"build:simulator": "npx -y -p=garmin-scripts build --simulator fr645m",
"era:live": "npx -y -p=garmin-scripts era 01234567-89ab-cdef-0123-456789abcdef",
"era:beta": "npx -y -p=garmin-scripts era fedcba98-7654-3210-fedc-ba9876543210",
"list-models-by-memory-usage": "npx -y -p=garmin-scripts list-models-by-memory-usage",
"list-models-by-bits-per-pixel": "npx -y -p=garmin-scripts list-models-by-bits-per-pixel",
"list-unused-models": "npx -y -p=garmin-scripts list-unused-models",
"get-model-by-product-id": "npx -y -p=garmin-scripts get-model-by-product-id 006-B3990-00"
}
}
Create a developer key and store it in a file named developer_key
in the root of your project.
.gitignore
!
Create a JSON file named .store
in the root of your project.
This file can have 3 properties: "release", "beta" and "debug". Each of them represents the application ID which is injected into your manifest.xml
, if you build of of these versions.
{
"release": "01234567-89ab-cdef-0123-456789abcdef",
"beta": "01234567-89ab-cdef-0123-456789abcdef",
"debug": "01234567-89ab-cdef-0123-456789abcdef"
}
If the application ID for a specific version is missing "00000000-0000-0000-0000-000000000000"
is used.
npx -y -p=garmin-scripts build --debug
npx -y -p=garmin-scripts build --beta
npx -y -p=garmin-scripts build --release
npx -y -p=garmin-scripts build --simulator fr645m
For --debug
amd --simulator
a device can specified. If the device name is omitted, the script will falls back to fenix7
.
As described above, the application IDs from the .store
are injected into the manifest.xml
, while running a build.
After the build is finished, the ID is unset.
It's important to have atleast id=""
in the iq:application
tag of your manifest.xml
, as this is the place where the ID is injected.
For example:
<iq:application id="" type="datafield" name="@Strings.AppName" entry="App" launcherIcon="@Drawables.LauncherIcon" minApiLevel="3.0.0">
While compiling using --debug
and --beta
, the script will crawl through all XML files and searches for such a tag:
<string id="AppName">[YOUR APPLICATION NAME]</string>
If it find one, it will append " (debug)"
to the app name string in --debug
mode, and " (beta)"
to the app name string in --beta
mode.
It is possible to include source code files only in debug mode or only in release/beta mode. To achieve this, give the respective files the extension ".debug.mc" or ".release.mc".
In debug mode, *.release.mc
files will be renamed to *.release.mc-
, while in release/beta mode *.debug.mc
filess will be renamed to *.debug.mc-
to force the compiler to ignore these files.
After the compilation is done, the files are renamed back to their original file name.
This can be helpful to create 2 versions of a module, one with logging of debug information or which mocks data, and one for the release version.
npx -y -p=garmin-scripts era 01234567-89ab-cdef-0123-456789abcdef
npx -y -p=garmin-scripts list-models-by-memory-usage
npx -y -p=garmin-scripts list-models-by-bits-per-pixel
npx -y -p=garmin-scripts list-unused-models
Error reports may only contain a Product ID. To get it's name, you can use this script.
npx -y -p=garmin-scripts get-model-by-product-id 006-B3990-00