vix mobile
vix mobile creates and runs a mobile shell for a Vix web or PWA application.
It is designed for apps that already expose a web interface, then need to be opened inside a mobile WebView.
vix mobile init android --name "My App" --url https://example.comThe current mobile target is Android.
Overview
vix mobile helps turn a Vix web app into a mobile app shell.
It can:
- generate an Android WebView project
- build the Android app
- install and launch it on a device
- generate a Gradle wrapper
- list connected Android devices
The generated Android app opens the URL you provide.
Vix web app or PWA -> Android WebView shellThe mobile command does not embed the Vix C++ runtime yet. Your Vix app still runs as a web application, and the Android shell opens it through WebView.
Usage
vix mobile init android [options]
vix mobile android [options]
vix mobile build android [options]
vix mobile run android [options]
vix mobile wrapper android [options]
vix mobile devicesThe short form:
vix mobile android --name "My App" --url https://example.comis equivalent to:
vix mobile init android --name "My App" --url https://example.comCreate an Android mobile shell
vix mobile init android \
--name "Softadastra" \
--package com.softadastra.app \
--url https://softadastra.comThis creates an Android project in:
mobile/androidUse a custom output directory:
vix mobile init android \
--name "Softadastra" \
--package com.softadastra.app \
--url https://softadastra.com \
--output apps/androidLocal development URL
For local testing, use the IP address reachable from the phone or emulator.
vix mobile init android \
--name "Vix UI Demo" \
--package com.vixcpp.demo \
--url http://192.168.1.10:8080 \
--allow-cleartextAndroid blocks plain http:// traffic by default. Use --allow-cleartext for local HTTP development.
For production, prefer HTTPS:
vix mobile init android \
--name "My App" \
--package com.example.app \
--url https://example.comBuild the Android app
vix mobile build androidBy default, Vix looks for the Android project in:
mobile/androidUse a custom project directory:
vix mobile build android --project apps/androidBuild a debug APK:
vix mobile build android --debugBuild a release APK:
vix mobile build android --releaseWhen the build succeeds, the APK is written under the Android build output directory.
Debug output:
app/build/outputs/apk/debugRelease output:
app/build/outputs/apk/releaseRun on Android
vix mobile run androidThis builds, installs, and launches the Android app on a connected device or emulator.
Use a custom project directory:
vix mobile run android --project apps/androidUse a specific package name:
vix mobile run android \
--project apps/android \
--package com.softadastra.appRun without installing first:
vix mobile run android --no-installUse release variant:
vix mobile run android --releaseList connected devices
vix mobile devicesThis uses adb devices.
Use it before vix mobile run android to confirm that an emulator or phone is connected.
Generate the Gradle wrapper
vix mobile wrapper androidUse a specific Gradle version:
vix mobile wrapper android --gradle-version 8.14.4Use the full Gradle distribution:
vix mobile wrapper android --distribution-type allRegenerate the wrapper even if it already exists:
vix mobile wrapper android --forceAndroid init options
| Option | Description |
|---|---|
--name <name> | App display name |
--url <url> | Web or PWA URL opened by the Android app |
--package <name> | Android package name. Default: com.vixcpp.mobile |
--output <dir>, -o <dir> | Output directory. Default: mobile/android |
--min-sdk <n> | Minimum Android SDK. Default: 23 |
--target-sdk <n> | Target Android SDK. Default: 36 |
--compile-sdk <n> | Compile Android SDK. Default: 36 |
--version-code <n> | Android version code. Default: 1 |
--version-name <name> | Android version name. Default: 1.0.0 |
--agp <version> | Android Gradle Plugin version. Default: 8.13.2 |
--allow-cleartext | Allow http:// traffic |
--no-cleartext | Disable cleartext HTTP traffic |
--force | Allow writing into a non-empty output directory |
Build and run options
| Option | Description |
|---|---|
--project <dir> | Android project directory. Default: mobile/android |
--package <name> | Android package name used when launching |
--debug | Build or install the debug variant |
--release | Build or install the release variant |
--gradle <command> | Gradle command to use |
--no-install | Launch without installing first |
Wrapper options
| Option | Description |
|---|---|
--project <dir> | Android project directory. Default: mobile/android |
--gradle <command> | Gradle command used to create the wrapper |
--gradle-version <version> | Gradle wrapper version. Default: 8.14.4 |
--distribution-type <type> | Wrapper distribution type: bin or all |
--force | Regenerate the wrapper if it already exists |
Output options
| Option | Description |
|---|---|
--quiet, -q | Only print errors |
--json | Print machine-readable lifecycle events |
--no-color | Disable ANSI colors |
Vix also respects:
NO_COLOR
FORCE_COLORGenerated Android project
A generated Android shell contains a normal Android app structure.
mobile/android/
settings.gradle
build.gradle
gradle.properties
local.properties
README.md
app/
build.gradle
src/main/
AndroidManifest.xml
java/<package>/MainActivity.java
res/values/
strings.xml
colors.xml
styles.xmllocal.properties is created automatically when Vix can detect the Android SDK.
The generated MainActivity opens the configured app URL in WebView.
Common workflows
Create an Android shell for a production site:
vix mobile init android \
--name "Softadastra" \
--package com.softadastra.app \
--url https://softadastra.comCreate an Android shell for local development:
vix mobile init android \
--name "Vix Local" \
--package com.vixcpp.local \
--url http://192.168.1.10:8080 \
--allow-cleartextGenerate the Gradle wrapper:
vix mobile wrapper androidBuild the debug APK:
vix mobile build androidInstall and launch:
vix mobile run androidCheck connected devices:
vix mobile devicesCommon mistakes
Using localhost on a real phone
Wrong for a real device:
vix mobile init android --name "My App" --url http://127.0.0.1:8080On a phone, 127.0.0.1 points to the phone itself, not your computer.
Use your computer LAN IP:
vix mobile init android \
--name "My App" \
--url http://192.168.1.10:8080 \
--allow-cleartextForgetting cleartext for local HTTP
Wrong for local HTTP:
vix mobile init android --name "My App" --url http://192.168.1.10:8080Correct:
vix mobile init android \
--name "My App" \
--url http://192.168.1.10:8080 \
--allow-cleartextUsing an invalid package name
Wrong:
vix mobile init android --package softadastraCorrect:
vix mobile init android --package com.softadastra.appThe package name should contain at least two valid parts separated by dots.
Building before creating the Android project
Wrong:
vix mobile build androidwhen mobile/android does not exist yet.
Correct:
vix mobile init android --name "My App" --url https://example.com
vix mobile build androidRunning without a connected device
Check devices first:
vix mobile devicesThen run:
vix mobile run androidTroubleshooting
Android project not found
Create it first:
vix mobile init android --name "My App" --url https://example.comOr pass the project path:
vix mobile build android --project apps/androidSDK location not found
Make sure ANDROID_HOME or ANDROID_SDK_ROOT points to your Android SDK.
Example:
export ANDROID_HOME="$HOME/Android/Sdk"You can also create local.properties inside the Android project:
sdk.dir=/home/user/Android/SdkGradle is not found
Generate the wrapper:
vix mobile wrapper androidOr pass a Gradle command:
vix mobile build android --gradle gradleDevice is not detected
Run:
vix mobile devicesThen confirm that USB debugging is enabled or that the emulator is running.
Difference between mobile commands
| Command | Purpose |
|---|---|
vix mobile init android | Generate the Android WebView shell |
vix mobile build android | Build the Android APK |
vix mobile run android | Install and launch the Android app |
vix mobile wrapper android | Generate the Gradle wrapper |
vix mobile devices | List connected Android devices |
Related commands
| Command | Purpose |
|---|---|
vix desktop | Run a Vix web UI inside a desktop shell |
vix run | Build and run a Vix target |
vix dev | Run a development server with reload |
vix build | Compile a project or target |
vix note | Run the Vix Note UI |