Skip to main content

xg-glass

This is a minimal command-line tool for driving an Android host project based on xg.glass:

  • xg-glass init <dir>: generate a developer project from a template (default: ./templates/kotlin-app, using includeBuild)
  • xg-glass build: build the phone host APK (for RayNeo, it will auto-generate and package the glasses host APK into assets before building)
  • xg-glass install: install onto the phone via adb install
  • xg-glass run: launch the app via adb shell monkey

Install from PyPI

pip install xg-glass

From PyPI, commands that operate inside an already-generated project work out of the box because they read xg-glass.yaml:

cd /path/to/generated-project
xg-glass build
xg-glass install
xg-glass run

For generated simulator projects, xg-glass run --sim now performs the simulator one-shot flow: it applies simulator build settings, builds, starts an Android Emulator when the selected serial is not already online, installs the APK, and launches it. --local_video /path/to/video.mp4 and --video_url <url> use the same simulator video path as quick mode.

Commands that create or synthesize a project (xg-glass init and xg-glass run <file.kt>) download the matching xg-glass-sdk release on first use and cache it under ~/.xg-glass/sdk/:

xg-glass init /path/to/myapp
xg-glass run /path/to/MyEntry.kt

Pass --sdk /path/to/xg-glass-sdk to use an existing checkout instead of the cached download. If the first-run download fails because you are offline or the matching tag is unavailable, retry when online or pass --sdk explicitly.

xg-glass init defaults to all supported Android devices for demos and zero-config exploration. For production-sized generated apps, pass --devices with a comma-separated list:

xg-glass init /path/to/myapp --devices even,simulator
xg-glass init /path/to/myapp --devices rokid,rayneo
xg-glass init /path/to/myapp --devices frame,simulator

Valid values are rokid, rayneo, meta, frame, omi, even, inmo, simulator, and all. Device names are case-insensitive. --sim still enables emulator build settings and also adds simulator to any concrete --devices selection.

From a repository checkout (contributors)

From the repository root (where xg-glass lives):

  • xg-glass init /path/to/myapp
  • cd /path/to/myapp
  • <path-to-sdk-repo>/xg-glass build
  • <path-to-sdk-repo>/xg-glass install
  • <path-to-sdk-repo>/xg-glass run

xg-glass.yaml (scalable)

xg-glass init generates xg-glass.yaml in the project root, and xg-glass build/install/run will read it automatically:

  • sdkPath
  • entryClass
  • rayneoMercuryAarDir
  • variant
  • module
  • applicationId
  • devices (written when --devices is provided, for example [even, simulator])

Bare-file quick mode (Quick mode)

You can use a single .kt file to trigger "temporary init → build → install → run":

  • xg-glass run /path/to/MyEntry.kt

Constraints:

  • The .kt file must contain a package ... line
  • The .kt file must contain a top-level class/object (used to infer the entry class)

Optional:

  • --entry-class <fqcn>: skip inference and specify the entry class explicitly
  • --sdk <path/to/sdk-repo>: specify the SDK path
  • --save ./myapp: persist the temporary project as a real project (so you can continue development)
  • --keep-tmp: keep the temporary directory for debugging
  • --sim: build a simulator-compatible APK (x86_64) and enable simulator backend
  • --local_video <mp4> / --video_url <url>: in --sim mode, feed simulator capturePhoto() from a local/downloaded video

Options

  • --project: specify the project root (default: current directory)
  • --variant: default debug
  • --serial: specify the adb device serial (optional)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xg_glass-0.2.0.tar.gz (47.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xg_glass-0.2.0-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

Details for the file xg_glass-0.2.0.tar.gz.

File metadata

  • Download URL: xg_glass-0.2.0.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for xg_glass-0.2.0.tar.gz
Algorithm Hash digest
SHA256 77560d39f1bb57b732f5b5d30485a81a57937831ae4d098b0d5b4025f7bc7f17
MD5 10a0201af2541874b8f8f5bbf94d3d47
BLAKE2b-256 3777d607edda08866e8211de32869a4d116ad1e31e193b9c7a7ab8f16982aa80

See more details on using hashes here.

File details

Details for the file xg_glass-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: xg_glass-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for xg_glass-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10afaaa2fb849f3bc834b5e24393545b4e1b97def30d788aa441bec9fb8d96b2
MD5 b54e857823bfc1eb498a265bba95dd4b
BLAKE2b-256 9287347deded66a1dcda10bf3637f6e232e474a9941c699448ea04674c146d68

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page