This repository provides Bazel rules for building, simulating, and testing Garmin Connect IQ applications. It streamlines the development process by integrating the Connect IQ SDK with Bazel's powerful build system.
manifest.xml and jungle files based on your build targets..prg application files for specific devices with type checking and optimization options..iq files for submission to the Connect IQ Store.Currenly only macOS is supported.
Before using these rules, ensure you have the following installed:
brew install libmtpCreate a .bazelrc file (see documentation)
containing the following reference to your CIQ developer key:
build --action_env=CIQ_DEVELOPER_KEY_PATH=/path/to/your/developer_key.der
Create a MODULE.bazel file for your project and add the rules_ciq dependency:
bazel_dep(name = "rules_ciq", version = "0.2.0")
If you'd prefer to be on the bleeding edge, instead use:
bazel_dep(name = "rules_ciq")
git_override(
module_name = "rules_ciq",
remote = "https://github.com/semolina-solutions/rules_ciq",
branch = "main",
)
Create a BUILD.bazel file for your project and declare targets using the
rules provided by this repository. See thesamples/hello_world
project for an introductory example. As a minimal demonstration, here is what to put in
the BUILD.bazel file to generate an app manifest for a widget file:
load("@rules_ciq//:defs.bzl", "ciq_manifest")
ciq_manifest(
name = "my_manifest",
entry = "MyApp",
id = "00000000-0000-0000-0000-000000000001",
launcher_icon_drawable_resource_id = "MyLauncherIconResource",
min_api_level = "3.0.0",
name_string_resource_id = "MyAppNameResource",
type = "widget",
)
Build, run or test your Bazel targets using bazel build, bazel run, or
bazel test. To generate the manifest file from the minimal example above, in
the same directory as the BUILD.bazel file, run in the terminal:
bazel build my_manifest
The generated file will be written to the bazel-bin directory. You can
observe that all devices that support widgets and a minimum API level
3.0.0 are included.
| Sample | Purpose |
|---|---|
| samples/hello_world | Introductory example demonstrating project structure, manifest generation, simulating, unit testing, uploading to physical devices, and .iq export. |
| samples/device_parametrics | Illustrates how to generate device-specific resources like icons and backgrounds. |
| samples/custom_font | Examples of generating custom bitmap fonts, including scaling relative to screen size or matching native SDK font heights. |
| samples/screen_ppi | Demonstrates how to scale resources based on physical screen dimensions. |
| samples/store | Examples of generating store assets, including device-framed screenshots and animated GIFs. |
Stardoc-generated documentation is available in the stardoc directory.
| File | Purpose |
|---|---|
| stardoc/defs.bzl | Documentation for rules and supporting functions in defs.bzl |
| stardoc/macros.bzl | Documentation for helper macros in macros.bzl |
This SDK is free and open-source under the MIT license.
If you're using it in a commercial or production environment and need:
you can purchase a commercial support contract.
Contact: garmin@semolina.solutions
0.2.0 +1.2mo2026-01-09 | |
0.1.02025-12-03 |