Skip to content

Build your application

Start with build.py. It discovers plugins, checks changes, and updates build outputs automatically. Refresh Studio after a successful build.

Run commands from the complete toolkit root#

ObjectivemacOS / LinuxWindows PowerShell
Automatic incremental builds for both sides./build.pypy build.py
Check and build only the glasses side./build.py glasspy build.py glass
Check and build only the Web side./build.py webpy build.py web
Watch local changes continuously./build.py --watchpy build.py --watch
List discovered projects and outputs./build.py --listpy build.py --list
Reruns the selected build process./build.py --forcepy build.py --force
View options./build.py --helppy build.py --help

What the script handles automatically#

Build components, then combine them in StudioA GlassSDK build generates the GMP, build manifest, and encrypted source attachment together. PhoneSDK generates the MMPKG. Studio combines existing outputs; uncompiled source changes do not automatically become the source corresponding to a GMP.MEMOMIND / BUILD ARTIFACTSBuild components, then combine them in StudioGlasses C projectSource and GCCdependenciesDirect, indirect,system header filesUse full filecontentBuild and RecordCompile GMPRecord commands anddependency snapshotsThree matchingoutputs.gmp / .review.json.review-source.encPhone Web projectWeb source andassetsStatic page orframework projectBuild and PackBuild frameworkoutput to staticfilesCheck manifest andpermissionsWeb component.mmpkgPage, JS andresourcesSource change → rebuild → refresh/select in Studio → wait for the new ZIP. Sourcedependencies are collected during the SDK build.
Build components, then combine them in StudioA GlassSDK build generates the GMP, build manifest, and encrypted source attachment together. PhoneSDK generates the MMPKG. Studio combines existing outputs; uncompiled source changes do not automatically become the source corresponding to a GMP.MEMOMIND / BUILD ARTIFACTSBuild components, thencombine them in StudioGlasses C projectSource and GCCdependenciesDirect, indirect, systemheader filesUse full file contentBuild and RecordCompile GMPRecord commands anddependency snapshotsThree matching outputs.gmp / .review.json.review-source.encPhone Web projectWeb source and assetsStatic page or frameworkprojectBuild and PackBuild framework output tostatic filesCheck manifest andpermissionsWeb component.mmpkgPage, JS and resourcesSource change → rebuild →refresh/select in Studio → wait forthe new ZIP. Source dependencies arecollected during the SDK build.
Build outputs come from the same source snapshot. Studio combines the selected components into the final ZIP.
  • At the complete toolkit root, the script checks GlassSDK and PhoneSDK. You can also enter either directory and run ./build.py directly, or py build.py on Windows.
  • Glasses: discovers examples projects automatically. Ninja incrementally compiles C sources and header dependencies, and the build generates matching source-build attachments.
  • Web: discovers examples projects automatically. Static pages are packaged directly. Projects with a package.json build script install npm dependencies as needed, run the build, and package dist.
  • A normal run checks once and exits. Add --watch to keep watching, and press Ctrl+C to stop.
  • This only checks local workspace changes; it does not run git pull automatically. New projects under examples are discovered. External C projects still use --project, and external Web static directories can be packaged separately.

Where to find successful build outputs#

  • Glasses examples: GlassSDK/build-host/.build/<example-relative-path>/<directory-name>.gmp, with matching .review.json and .review-source.enc files.
  • Web examples: PhoneSDK/dist/<directory-name>-<version>.mmpkg. Projects with a frontend build step must generate static assets first.
  • Final ZIP: generated by Studio from the dropdown selections, with its path shown beside the QR-code area. The SDK build terminal does not generate a QR code.

Rebuild missing sidecars when the GMP already exists#

If the terminal reports everything up to date but Studio reports a missing .review.json or .review-source.enc, check the two matching attachments beside the GMP. The complete toolkit's incremental entry point currently checks output completeness based on GMP existence, so a normal build may skip when only the attachments are missing.

From the complete toolkit root, run the command below for your OS to re-enter the glasses build and source-snapshot process. Wait for success and confirm all three output files exist. Ninja can still reuse unchanged C build outputs; there is no need to delete the project or the entire toolchain cache.

macOS / Linux

< / >
./build.py glass --force

Windows PowerShell

< / >
py build.py glass --force

Projects outside the examples directory#

A glasses project containing manifest.json and at least one .c file can use --project. If shared headers are in a parent working directory, specify --source-root and --include-dir explicitly.

Web build.py scans PhoneSDK/examples automatically. External Web projects do not use --project. Build the frontend in your own project, pass the static directory containing manifest.json and the entry page to PhoneSDK/tools/build-mmpkg.mjs, then import the output MMPKG into Studio.

< / >
# 在完整开发套件根目录执行;把路径换成实际目录
python3 GlassSDK/build.py build --project /work/my-plugin --source-root /work --include-dir /work/shared/include

Output paths and project naming#

  • External --project builds default to <project>/.build/<project-directory-name>/, which differs from the examples output directory.
  • Use letters, digits, underscores, dots, or hyphens for external project directory names. Quote paths containing spaces. CMake project paths cannot contain semicolons.
  • PhoneSDK joins nested example directories with hyphens in output names. For example, examples/tools/my-web produces dist/tools-my-web-<version>.mmpkg. Use the path printed by the build terminal.

Reference files in the toolkit#

  • README.md
  • GlassSDK/README.md
  • GlassSDK/docs/REVIEW_PACKAGES.md
  • PhoneSDK/README.md