Device test packages and packaging
Compile both components with build.py at the toolkit root, then generate the complete ZIP with matching Studio. Use the original Studio file for scanning and retesting. Do not manually add, remove, replace, or repackage its contents. The official outputs of the matching SDK and Studio define the package.
Generate the final package#
- Build components using the guide, then select the outputs according to Studio's update instructions. For custom GMP, keep matching .gmp, .review.json, and .review-source.enc files. Confirm any Web MMPKG is updated.
- Check the current Studio combination, wait for packaging, and keep the complete ZIP shown beside the QR code.
- Follow the scanning guide for device validation. The following sections explain this ZIP's contents, attachments, and limits.
Purpose of each official build artifact#
This table explains common artifacts in matching releases; it is not a manual package-assembly checklist. Use the complete SDK and Studio outputs as authoritative.
| Part | Purpose | Runtime location |
|---|---|---|
| .gmp (when a custom glasses component is included) | Compiled glasses plugin image. | Executed by the Studio simulator or glasses firmware. |
| .mmpkg (when required by the combination) | Web page, JavaScript, resources and manifest. | Studio Web host or mobile phone App WebView. |
| review.json | Build attachment manifest, digests, and association information. | For Studio and App validation, not glasses business code. |
| source.enc | Compressed and encrypted glasses source, all dependency headers read by GCC, and build records. | Saved in the complete ZIP; not sent to the glasses for execution. |
How source files and headers are collected#
GlassSDK records a source snapshot and complete build information. Direct, indirect, and system headers actually read by GCC are preserved unchanged, regardless of whether their functions are referenced. External shared directories contribute only dependencies, not their entire contents.
Protection boundaries of build sidecars#
Ordinary ZIP tools can read outer runtime files. Encryption protects the glasses source attachment; it does not guarantee that GMP or Web JavaScript cannot be analyzed. Studio and the App run without the source-decryption private key.
File digests detect inconsistent package contents; they do not prove the binary was built from those sources. Do not edit, replace, or borrow another version's attachments. Rebuild and generate a new complete ZIP after source or dependency changes.
Final checks before scanning#
- Confirm that Studio has finished packing and displays the current QR code; Do not select a source code directory or only one GMP to replace the full ZIP.
- Check the package's application name, version, Web permissions, and both selected components.
- Keep verified files. After source, component, or configuration changes, rebuild, repackage, and retest on devices.
Build-package and device-runtime limits#
| Level | Current Limit |
|---|---|
| GMP v2 / XIP Build | Flash code and read-only constants ≤500 KiB (512000 B); static RAM strictly <100 KiB (102400 B). The GMP package also includes a 120 B header, relocation metadata, and initial RAM data. Its total validation limit is 3 MiB−64 KiB, and storage also depends on available cache capacity. The entire GMP is not limited to ≤500 KiB. |
| C function stack limit | The SDK compiler checks that each function has a static stack frame ≤1024 B. Exceeding the limit or using dynamic stack allocation (such as VLA/alloca) fails the build and prompts you to use managed malloc. This check does not calculate recursion, full call chains or the total stack depth of Host callbacks. |
| Runtime budget | The display task and Flash worker each have an 8192 B stack. Plugin callbacks share the display-task/Host-call stack; each callback does not get its own stack. Check malloc failures and release allocations according to lifecycle. Moving data to the heap still consumes RAM. |
| MMPKG packaging | build-mmpkg.mjs: package ≤10 MiB, total extracted content ≤30 MiB, each file ≤10 MiB, and at most 500 files. |
Reference files in the toolkit#
- GlassSDK/docs/REVIEW_PACKAGES.md
- PhoneSDK/docs/web-plugin/package-format.md
- GlassSDK/docs/ABI.md
- GlassSDK/build-host/tools/gmp_xip_pack.py
- GlassSDK/build-host/tools/xip_compile.py