The Mason CLI provides command line tools to help you manage your devices in the Mason Platform.
Installing the CLI
Visit the latest release of the Mason CLI's GitHub page. Under the “Assets” section, download the variant of the CLI for your platform.
- In Explorer, open the folder where the
mason.exefile you downloaded is located (typically in
- Still in Explorer, press
Ctrl + L, then type
cmdand press enter
- In the Command Prompt window that opened, type
mason.exe -Vto ensure the version you downloaded matches what you see:
$ mason.exe -V Mason CLI %%DOWNLOADED_VERSION_HERE%%
- Open a terminal in the directory the CLI was downloaded
- Add the CLI to your bin directory
- Linux: run
mkdir -p ~/.local/bin && mv mason-linux $_/mason && chmod +x $_
- macOS: run
sudo mkdir -p /usr/local/bin && sudo mv mason-macos $_/mason && chmod +x $_
- Linux: run
mason -Vto ensure the version you downloaded matches what you see:
$ mason -V Mason CLI %%DOWNLOADED_VERSION_HERE%%
- Optional: run
echo -e 'eval "$(_MASON_COMPLETE=source mason)"\n' >> .bashrcto get autocomplete support for mason commands in bash.
If you run into security exceptions on macOS Catalina, check here for workarounds.
Mason Platform lifecycle
The Mason CLI provides plumbing to orchestrate changes across your device fleet, but such changes have a lifecycle that must be followed. These steps will give you a general idea of the Mason Platform's lifecycle:
mason login: Authenticates you with the Mason Platform.
mason register apk: Uploads your app to be used in OS configurations.
mason register media: Uploads media such as a boot animation to be used in OS configurations.
mason stage: Uploads and builds an OS configuration to be deployed to device groups.
mason deploy config: Deploys an OS configuration to device groups.
- If you are unfamiliar with the terminal, we recommend getting some practice.
- Use the
--helpoption on any command to get a detailed explanation of how to use it. For example:
$ mason login --help Usage: mason login [OPTIONS] ...
- If something goes wrong, rerun the command with
-v debugto get more information. If you think you've found a bug, please report it on our issue tracker.
login command authenticates you with the
Currently, your session will be saved for ~1 day. If you'd like to end your session earlier than that,
Logs you out of a running session. This command can be useful for security purposes.
Available artifact types to register are:
Note: Registered artifacts are available here.
mason register apk
Before you register an APK, you must ensure that:
- It is signed with a non-debug signing key.
- If it is already deployed,
- the APK is signed with the same signing certificate you used previously.
versionCodeis larger than the previous value.
mason register media
register media command lets you upload media artifacts to be used later in
Available media types to register are:
mason register config
regiser config command lets you upload OS configurations.
These are the core of the Mason Platform, representing a Mason Project to define a device's
behavior. Configs can be built and then subsequently deployed to a
group of devices.
stage command registers a config and then immediately
builds it. These two steps must be performed before an OS configuration can be
deployed to devices, so this command is the recommended way to register a config.
After building an OS configuration, you'll probably want to deploy it.
To view the status of your builds, check here.
build command lets you build a previously registered OS
deploy command lets you make changes to your devices in the field.
Available deployables are:
Note: Once something is deployed, the next successful check-in from a device against the Mason
Platform will result in the artifact being retrieved and installed. Since this could could take a
non-deterministic amount of time, the
--push option is provided to deploy something immediately.
mason deploy apk
mason deploy config
deploy config command lets you deploy an OS configuration. This will require a full device
reboot and will update the device's behavior according to the specified configuration. You'll need a
Mason Project, its version, and a
device group to deploy to.
mason deploy ota
deploy ota command lets you update Android's core components. You will receive emails from us
when a new version of Mason OS is available.