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#
| Objective | macOS / Linux | Windows PowerShell |
|---|---|---|
| Automatic incremental builds for both sides | ./build.py | py build.py |
| Check and build only the glasses side | ./build.py glass | py build.py glass |
| Check and build only the Web side | ./build.py web | py build.py web |
| Watch local changes continuously | ./build.py --watch | py build.py --watch |
| List discovered projects and outputs | ./build.py --list | py build.py --list |
| Reruns the selected build process | ./build.py --force | py build.py --force |
| View options | ./build.py --help | py build.py --help |
What the script handles automatically#
- 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 --forceWindows PowerShell
py build.py glass --forceProjects 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/includeOutput 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