44 lines
1.3 KiB
Batchfile
44 lines
1.3 KiB
Batchfile
@echo off
|
|
|
|
echo ============================================
|
|
echo MusicRoom Android - Run App
|
|
echo ============================================
|
|
echo.
|
|
|
|
:: Ensure Scoop shims and SDK tools are in PATH
|
|
set "PATH=%PATH%;%USERPROFILE%\scoop\shims"
|
|
set "JAVA_HOME=%USERPROFILE%\scoop\apps\temurin17-jdk\current"
|
|
set "ANDROID_HOME=%LOCALAPPDATA%\Android\Sdk"
|
|
set "PATH=%PATH%;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\emulator"
|
|
|
|
:: Start emulator if not already running
|
|
adb devices 2>nul | findstr "emulator" >nul
|
|
if errorlevel 1 (
|
|
echo Starting emulator...
|
|
start "" "%ANDROID_HOME%\emulator\emulator.exe" -avd Medium_Phone_API_36.0
|
|
echo Waiting for emulator to boot...
|
|
adb wait-for-device
|
|
:wait_boot
|
|
adb shell getprop sys.boot_completed 2>nul | findstr "1" >nul
|
|
if errorlevel 1 (
|
|
timeout /t 2 /nobreak >nul
|
|
goto :wait_boot
|
|
)
|
|
echo Emulator ready.
|
|
echo.
|
|
)
|
|
|
|
:: Build and install the app
|
|
::: Build, install, and run the app (starts Metro automatically)
|
|
echo Building and installing MusicRoom...
|
|
echo.
|
|
call bunx react-native run-android
|
|
|
|
echo.
|
|
echo ============================================
|
|
echo App is running. Leave this window open --
|
|
echo Metro is serving the JS bundle.
|
|
echo Press Ctrl+C to stop Metro when done.
|
|
echo ============================================
|
|
pause
|