Download mintlify-docs/app-devs/getting-started/distribution.mdx from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 5.42 kB
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mintlify-docs/app-devs/getting-started/distribution.mdx
- Command line
-
hf download hf://Anirudh1950/MentraOS/mintlify-docs/app-devs/getting-started/distribution.mdx
-
curl -L -o distribution.mdx https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mintlify-docs/app-devs/getting-started/distribution.mdx
5.42 kB
| --- | |
| title: "Distribution" | |
| description: "Prepare and install miniapp builds for local testing." | |
| icon: "upload" | |
| --- | |
| import LegacyCloudNote from '/snippets/legacy-cloud-note.mdx' | |
| import BetaNote from '/snippets/beta-note.mdx' | |
| <BetaNote /> | |
| A miniapp is a **bundle that runs on the user's phone**. This page covers | |
| putting builds on your own phones while you work. To share a miniapp with other | |
| people, see [Publish your miniapp](/app-devs/getting-started/publish). | |
| <LegacyCloudNote /> | |
| ## Dev install (you, iterating) | |
| While you're building, [`mentra-miniapp dev`](/app-devs/reference/cli#dev) serves | |
| your project over the LAN with hot reload. Scan the QR from the Mentra App and | |
| your changes reload on save. This is the inner loop; see the | |
| [Quickstart](/app-devs/getting-started/quickstart). | |
| Dev mode is not an installation: the computer and CLI must remain running to | |
| serve each miniapp's runtime bundle. The Mentra App keeps a separate dev entry | |
| for each manifest package name and caches its name and icon, so you can scan and | |
| test multiple dev miniapps together. Rescanning the same package updates that | |
| entry. Use a release install when you want the miniapp to run without the | |
| computer. On a phone signed in to a company workspace, the Miniapp Developer | |
| tools appear only if the workspace allows miniapp development. | |
| A dev build runs as the package named in its `miniapp.json`, so it can stand in | |
| for an installed copy of that package. Dev code is unsigned: the Mentra App runs | |
| it in place of an unsigned install, but refuses it while the package is | |
| installed from a bundle signed with a publisher key. Uninstall the miniapp from | |
| the phone first, then scan again. `session.auth` works in a dev build the same | |
| way it does for the installed miniapp. | |
| ## Release install (local testing over LAN) | |
| To put a real, installed build on one or more test phones on your local network, | |
| run: | |
| ```bash | |
| mentra-miniapp release | |
| ``` | |
| This builds, packs, and serves the bundle behind a `miniapp://release` QR. Anyone | |
| on the same network can scan it to install. The miniapp installs on the device, | |
| **runs offline, and persists across restarts**: no laptop required once it's | |
| installed. This is intended for local testing, demos, and dogfooding. To reach other | |
| people, [publish your miniapp](/app-devs/getting-started/publish). | |
| Each install is logged in your terminal, and the server stays up so multiple | |
| devices can install from the same QR. The miniapp opens on the phone as soon as | |
| it installs. | |
| A release install is a fixed snapshot, like a React Native release build. After | |
| each change, run `mentra-miniapp release` again and rescan. While you develop, | |
| use `mentra-miniapp dev` instead: scan once, and every saved change reloads on | |
| the phone. | |
| ## Publishing | |
| To share a miniapp, host it at an HTTPS URL and let people install it from there; | |
| they can also find it in the [Mentra Miniapp Store](https://apps.mentraglass.com) | |
| once Mentra staff list it. See [Publish your miniapp](/app-devs/getting-started/publish). | |
| The CLI writes the folder to upload: | |
| ```bash | |
| mentra-miniapp pack | |
| ``` | |
| The folder is written to `build/`, with the ZIP named | |
| `<packageName>-<version>.zip`. Make sure your | |
| [`miniapp.json`](/app-devs/core-concepts/miniapp-manifest) is accurate before you | |
| pack: its `hardwareRequirements` will decide which glasses can see your miniapp, | |
| and its `permissions` will drive the OS prompts users see. | |
| <Note> | |
| Camera, photo, and live-streaming features run through the on-glasses Bluetooth | |
| stack, not a cloud server. See the [Bluetooth SDK docs](/bluetooth-sdk/overview) | |
| for those workflows. | |
| </Note> | |
| ## Versioning | |
| Bump `version` in `miniapp.json` for every release build; it must be a semantic | |
| version such as `1.2.0`. The CLI names the artifact | |
| `<packageName>-<version>.zip`. | |
| The Mentra App installs a release only when its version is the same as or newer | |
| than the installed one. Installing the same version again replaces it; an older | |
| version is refused, whether it comes from a release QR or is bundled with the | |
| Mentra App. To go back to an older build, publish it again under a newer version. | |
| ## Signing | |
| Signing is optional. `mentra-miniapp pack --sign` (or `release --sign`) embeds a | |
| publisher signature in the bundle; see [Signing](/app-devs/reference/cli#signing) | |
| for keys and CI. The Mentra App follows the Android model: the installed signer | |
| decides which bundles may replace a miniapp. | |
| | Installed miniapp | Incoming bundle | Result | | |
| |---|---|---| | |
| | none, or unsigned | unsigned | installs | | |
| | none, or unsigned | signed | installs, and pins the miniapp to that key | | |
| | signed with key A | signed with key A | installs | | |
| | signed with key A | signed with key B | refused | | |
| | signed with key A | unsigned, or a dev build | refused: uninstall first | | |
| Uninstalling the miniapp clears its recorded key. The same rule applies to every | |
| way a miniapp reaches the phone; there is no exception for first-party miniapps. | |
| ## Next steps | |
| <CardGroup cols={2}> | |
| <Card title="CLI reference" icon="terminal" href="/app-devs/reference/cli"> | |
| `dev`, `release`, and `pack` in detail. | |
| </Card> | |
| <Card title="The manifest" icon="file-code" href="/app-devs/core-concepts/miniapp-manifest"> | |
| Get permissions and hardware requirements right before you build a release. | |
| </Card> | |
| </CardGroup> | |