#!/bin/bash # Android Emulator Launch Script - ANGLE Mode # Uses ANGLE (Almost Native Graphics Layer Engine) for better NVIDIA compatibility # Alternative to host GPU mode when experiencing binding issues # Author: Matthew Raymer echo "🚀 Launching Android Emulator - ANGLE Mode..." # Check if emulator command exists if ! command -v emulator &> /dev/null; then echo "❌ Error: Android emulator not found!" echo "Please install Android Studio and add emulator to PATH" exit 1 fi # Check if AVD exists if ! emulator -list-avds | grep -q "TimeSafari_Emulator"; then echo "❌ Error: TimeSafari_Emulator AVD not found!" echo "Available AVDs:" emulator -list-avds exit 1 fi echo "✅ Environment checks passed" echo "🎮 Starting emulator with ANGLE rendering..." # Launch emulator with ANGLE and performance tuning QT_QPA_PLATFORM=xcb \ __NV_PRIME_RENDER_OFFLOAD=1 \ __GLX_VENDOR_LIBRARY_NAME=nvidia \ DRI_PRIME=1 \ emulator -avd TimeSafari_Emulator \ -gpu angle_indirect \ -accel on \ -cores 6 \ -memory 4096 \ -no-boot-anim \ -no-snapshot-load \ -feature -Bluetooth echo "🎯 Emulator launched with ANGLE rendering!" echo "" echo "📋 Configuration:" echo " - ANGLE indirect rendering" echo " - NVIDIA GPU offloading" echo " - 6 CPU cores allocated" echo " - 4GB RAM allocated" echo " - Hardware acceleration enabled" echo " - Fast startup (no boot animation)" echo " - Clean state (no snapshot loading)" echo " - Bluetooth disabled (prevents hangs)" echo "" echo "🔍 Benefits:" echo " - Better NVIDIA compatibility on Linux" echo " - Avoids mixed Vulkan+OpenGL binding issues" echo " - More stable rendering pipeline" echo " - Good fallback when host GPU mode fails"