Lex Talionis Web supports two paths for native mobile distribution:
- Capacitor — full native wrapper for iOS and Android (recommended)
- TWA — Trusted Web Activity for Android (lighter, PWA-based)
Capacitor wraps the web app in a native WebView. This gives you:
- App store distribution (iOS App Store, Google Play)
- Full native API access (keep-awake, orientation lock, haptics)
- Offline support via bundled assets
# Install Capacitor (already in devDependencies)
npm install
# Add native platforms
npx cap add ios
npx cap add android
# Build the web app
npm run build
# Optional: bundle game assets for offline play
npm run bundle
cp public/bundles/default.ltproj.zip dist/bundles/
# Sync web build to native projects
npx cap sync# Live reload on device
npx cap run ios --livereload --external
npx cap run android --livereload --external
# Open in IDE
npx cap open ios # opens Xcode
npx cap open android # opens Android StudioiOS:
npx cap open ios- In Xcode: Product → Archive → Distribute App
Android:
npx cap open android- In Android Studio: Build → Generate Signed Bundle/APK
# Keep screen awake during gameplay
npm install @capacitor-community/keep-awake
# Lock screen orientation
npm install @capacitor/screen-orientation
# Hide status bar for fullscreen
npm install @capacitor/status-bar
# Haptic feedback for button presses
npm install @capacitor/hapticsA Trusted Web Activity wraps the PWA in Chrome Custom Tabs — no WebView, just Chrome rendering the PWA without browser UI. Lighter than Capacitor but requires the PWA to be hosted at a public HTTPS URL.
- Host the PWA at a public HTTPS URL
- Ensure the service worker and manifest are working
- Set up Digital Asset Links (
.well-known/assetlinks.json)
# Install Bubblewrap CLI
npm install -g @nicweb/nicandmicah
# Initialize from your hosted manifest
npx bubblewrap init --manifest https://your-domain.com/manifest.json
# Build the APK
npx bubblewrap buildEdit twa/bubblewrap.config.json:
- Set
hostto your actual domain - Update signing key path and alias
- Bump
appVersionCodefor each release
Create .well-known/assetlinks.json on your web server:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.lextalionis.web",
"sha256_cert_fingerprints": ["YOUR_SHA256_FINGERPRINT"]
}
}]Get your fingerprint:
keytool -list -v -keystore lt-web-keystore.jks -alias lt-webFor native builds, you want game assets available offline:
# Create the asset bundle
npm run bundle
# Copy to the web build directory
mkdir -p dist/bundles
cp public/bundles/default.ltproj.zip dist/bundles/
# Sync to native projects
npx cap syncThe app automatically detects and loads the bundle on startup.