ota
Uploading release files and deploying updates from your CI system is a great way to automate the process of releasing new versions. This guide will show you how to use the HexDroid CLI to upload release files and deploy updates from your CI system.
The HexDroid CLI is used to upload release files and deploy updates, invoke these commands after you have built your software/firmware.
$ java -jar hexdroid-cli.jar ota
Usage: hexdroid-cli ota [COMMAND]
Set of commands related to Update/Release (OTA) Management
Using these commands you can create releases, upload payload files, and change update rollout.
Commands:
new-release Creates a new release based on provided version and target
upload-payload After release is created, release payloads are files/binaries that are associated with this release.
new-rollout After release is created, payloads uploaded - it's time to create a rollout for this release
add-sbom Creates a new release based on provided version and target
Create release
NOTE: Creating release will not make it available to end devices, for that rollout needs to be created (see next steps).
hexdroid-cli ota new-release \
--apiKey=<apiKey> \
--target=<target> \
--versionCode=versionCode \
--versionName=<versionName>
Upload release payload
Full payload
Full payload provides complete payload data, typically larger in size but works for any version.
hexdroid-cli ota upload-payload \
--distributed=<distributed> \
--apiKey=<apiKey> \
--file=<file> \
--target=<target> \
--type=<payloadType> \
--versionCode=<versionCode> \
--fullPayload
Incremental payload
Incremental payload: Smaller in size but can only update from a specific from_version_code
to the target version,
requiring exact version matching
hexdroid-cli ota upload-payload \
--distributed=<distributed> \
--apiKey=<apiKey> \
--file=<file> \
--target=<target> \
--type=<payloadType> \
--versionCode=<versionCode> \
--incrementalPayload=<from_version_code>
Create rollout
When release payloads are uploaded, to start the rollout to fleet, issue this command, after rollout is activated - this release will be available to selected fleet devices.
Activate
hexdroid-cli ota new-rollout \
--apiKey=<apiKey> \
--cohortSlug=<cohorSlug> \
--target=<target> \
--versionCode=<versionCode> \
--activate=<rollout_percentage>
Halt
To abort/halt release, you can issue this command; this will stop any new devices in the cohort from receiving this update.
hexdroid-cli ota new-rollout \
--apiKey=<apiKey> \
--cohortSlug=<cohortSlug> \
--target=<target> \
--versionCode=<versionCode> \
--halt
Uploading SBOMs
HexDroid CLI provides two convenient methods for uploading your Software Bill of Materials (SBOMs): via standard input ( stdin) or directly from a file path.
Uploading via Standard Input (stdin)
This method is ideal for piping the output of another command directly as your SBOM data.
Example: To upload the dependency tree generated by a Gradle command as an SBOM:
./gradlew app:dependencies | java -jar hexdroid-cli.jar ota add-sbom --stdin --versionCode=1 --target=smart_oven --type="gradle"
Uploading from a File Path
Alternatively, you can specify the path to your SBOM file.
Example: To upload an AOSP pinned manifest file as an SBOM:
java -jar hexdroid-cli.jar ota add-sbom --versionCode=1 --target=smart_oven --file=/build/aosp/aosp_pinned_manifest.xml --type="aosp_manifest"