Skip to main content

Overview

Stage Pocket is the mobile version of AIRI, built with Capacitor to bring the full AIRI experience to iOS and Android devices. It shares the same Vue 3 codebase as Stage Web, wrapped in native mobile containers.
Stage Pocket is currently in early development. Some features may be limited or unavailable.

Platform Support

iOS

  • Minimum: iOS 13.0+
  • Recommended: iOS 15.0+
  • Devices: iPhone 8 and newer
  • Simulator: Xcode 14+ required for development

Android

  • Minimum: Android 7.0 (API 24)+
  • Recommended: Android 10.0 (API 29)+
  • Devices: Any device with WebView support
  • Emulator: Android Studio required for development

Capacitor Setup

Stage Pocket uses Capacitor to bridge web code to native mobile platforms.

Key Configuration

// capacitor.config.ts
import type { CapacitorConfig } from '@capacitor/cli'

const config: CapacitorConfig = {
  appId: 'ai.moeru.airi',
  appName: 'AIRI',
  webDir: 'dist',
  server: {
    url: process.env.CAPACITOR_DEV_SERVER_URL,
    cleartext: false
  }
}

Installed Plugins

  • @capacitor/core: Core Capacitor runtime
  • @capacitor/ios: iOS platform support
  • @capacitor/local-notifications: Push notifications
  • Custom plugins for AIRI-specific features

Development Setup

Prerequisites

  • macOS (required for iOS development)
  • Xcode 14+ (26+ recommended for new icon format)
  • iOS 13+ device or simulator
  • Apple Developer account (for device testing)
  • CocoaPods: sudo gem install cocoapods

Installation

Clone the repository and install dependencies:
git clone https://github.com/moeru-ai/airi.git
cd airi
pnpm install

Development Workflow

1

Start Web Development Server

pnpm dev:pocket
This starts Vite development server. Note your IP address from the output:
  Local:   https://localhost:5273/
  Network: https://192.168.1.100:5273/
2

Open Native IDE

# Set your development server URL
export CAPACITOR_DEV_SERVER_URL=https://192.168.1.100:5273
pnpm open:ios
This will:
  1. Build the web app
  2. Sync assets to iOS project
  3. Open Xcode
3

Run on Device/Simulator

  • Xcode: Click the “Run” button (Cmd + R)
  • Android Studio: Click “Run ‘app’” (Shift + F10)
The app will launch with live reload from your development server.

Hot Reload

Changes to your web code will automatically reload in the mobile app when connected to the development server.
Both your development machine and mobile device must be on the same network for hot reload to work.

Building for Production

iOS Build

1

Build Web Assets

pnpm -F @proj-airi/stage-pocket build
2

Sync to iOS

npx cap sync ios
npx cap open ios
3

Configure Signing

In Xcode:
  1. Select project in navigator
  2. Select “AIRI” target
  3. Go to “Signing & Capabilities”
  4. Select your team and provisioning profile
4

Archive and Upload

  1. Product → Archive
  2. Wait for archive to complete
  3. Click “Distribute App”
  4. Follow App Store Connect wizard

Android Build

1

Build Web Assets

pnpm -F @proj-airi/stage-pocket build
2

Sync to Android

npx cap sync android
npx cap open android
3

Generate Signed APK/AAB

In Android Studio:
  1. Build → Generate Signed Bundle / APK
  2. Select Android App Bundle (recommended) or APK
  3. Select/create keystore
  4. Build release variant
4

Upload to Play Console

  1. Open Google Play Console
  2. Select your app
  3. Go to Release → Production
  4. Upload AAB file

Running on Physical Devices

iOS Device

1

Enable Developer Mode

On iOS 16+:
  1. Settings → Privacy & Security → Developer Mode
  2. Toggle on and restart device
2

Trust Developer Certificate

On first run:
  1. Settings → General → VPN & Device Management
  2. Select your developer certificate
  3. Tap “Trust”
3

Run from Xcode

  1. Connect device via USB
  2. Select device from target menu
  3. Click Run (Cmd + R)

Android Device

1

Enable Developer Options

  1. Settings → About Phone
  2. Tap “Build Number” 7 times
  3. Go back to Settings → System → Developer Options
2

Enable USB Debugging

  1. Developer Options → USB Debugging (ON)
  2. Connect device via USB
  3. Accept debugging prompt on device
3

Run from Android Studio

  1. Select device from target menu
  2. Click Run (Shift + F10)

Mobile-Specific Features

Native Capabilities

  • Local Notifications: Background reminders and alerts
  • Haptic Feedback: Tactile responses to interactions
  • Native Navigation: iOS/Android navigation patterns
  • Biometric Auth: Face ID, Touch ID, fingerprint (planned)
  • Native Sharing: Share to other apps
  • Background Audio: Continue audio playback when app is backgrounded (planned)

Mobile-Optimized UI

  • Touch-optimized controls
  • Responsive layouts for various screen sizes
  • Bottom navigation for easy thumb access
  • Gesture support (swipe, pinch-to-zoom)
  • Native keyboard handling

Storage

// Using Capacitor Storage
import { Preferences } from '@capacitor/preferences'

// Save data
await Preferences.set({ key: 'user_id', value: '123' })

// Retrieve data
const { value } = await Preferences.get({ key: 'user_id' })

Notifications

import { LocalNotifications } from '@capacitor/local-notifications'

// Request permission
await LocalNotifications.requestPermissions()

// Schedule notification
await LocalNotifications.schedule({
  notifications: [{
    id: 1,
    title: 'AIRI',
    body: 'Your AI companion is waiting!',
    schedule: { at: new Date(Date.now() + 3600000) }
  }]
})

Limitations

Compared to desktop/web versions:
Technical Limitations
  • Limited GPU memory on mobile devices
  • Smaller models required for acceptable performance
  • Background processing restrictions (iOS/Android)
  • No native CUDA/Metal support (uses WebGPU in WebView)
  • Reduced battery life with intensive AI tasks
  • Network-dependent for large model inference
Feature Limitations
  • No desktop game integrations (Minecraft, Factorio)
  • No screen capture capabilities
  • Limited file system access
  • No Discord bot features
  • Simplified UI due to screen size constraints
  • No system tray functionality

Performance Considerations

  • Use smaller, optimized models
  • Leverage server-side inference when possible
  • Implement aggressive caching strategies
  • Optimize asset loading for cellular networks
  • Monitor battery usage and heat generation

Wireless Server Channel

Connect Stage Pocket to Stage Tamagotchi for enhanced features:
1

Start Tamagotchi as Root (macOS/Linux)

sudo pnpm dev:tamagotchi
Root access is required for secure WebSocket connections.
2

Enable Secure WebSocket in Tamagotchi

  1. Open Tamagotchi Settings
  2. Navigate to System → General
  3. Enable “Secure WebSocket”
  4. Note the server address displayed
3

Connect from Pocket

  1. Open Stage Pocket on your mobile device
  2. Go to Settings → Server Channel
  3. Enter the server address from Tamagotchi
  4. Tap “Connect”
This allows mobile app to:
  • Offload inference to desktop GPU
  • Access desktop’s model library
  • Share chat history and settings
  • Use desktop plugins and integrations

Troubleshooting

Build Fails

# Clean Xcode build
cd ios/App
rm -rf DerivedData
xcodebuild clean

# Reinstall pods
pod deintegrate
pod install

Device Not Detected

  • iOS: Check USB connection, trust computer prompt
  • Android: Enable USB debugging, install device drivers (Windows)
  • Try different USB cable or port

App Crashes on Launch

  1. Check device logs:
    • iOS: Xcode → Window → Devices and Simulators → View Device Logs
    • Android: Android Studio → Logcat
  2. Verify WebView version is up to date
  3. Check for JavaScript errors in web console
  4. Ensure native dependencies are properly linked

Technology Stack

  • Framework: Capacitor 7
  • Web Layer: Vue 3 + Vite (shared with Stage Web)
  • iOS: Swift + WKWebView
  • Android: Kotlin + WebView
  • State: Pinia
  • Graphics: WebGPU (in WebView)
  • Database: DuckDB WASM
  • Styling: UnoCSS

App Store Deployment

Pre-submission Checklist

Prepare assets:
  • App icon (1024x1024)
  • Screenshots for all device sizes
  • Privacy policy URL
  • App description and keywords
  • Promotional images (optional)
Configure metadata:
  • App name and subtitle
  • Category selection
  • Age rating
  • Price (free/paid)
  • In-app purchases (if any)
Review guidelines compliance:

Submission Process

  1. Archive app in Xcode
  2. Upload to App Store Connect
  3. Fill out app information
  4. Submit for review
  5. Wait 1-3 days for approval

Web Platform

Browser-based version with WebGPU

Desktop Platform

Native Electron app with full features

Build docs developers (and LLMs) love