-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuildem-windows.bat
More file actions
39 lines (31 loc) · 888 Bytes
/
buildem-windows.bat
File metadata and controls
39 lines (31 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
setlocal
REM Build mems
call ./build-windows.bat
echo [CMake] mems cpp source has been built.
REM Build frontend
cd frontend
call npm run build
echo Finished
cd ..
echo [React] Frontend built.
REM Prepare emulator
start emulator -avd Pixel -no-audio -gpu host -writable-system -no-snapshot-load -dns-server 8.8.8.8
adb wait-for-device
REM adb forward tcp:8000 tcp:8000
REM Move files to emulator
cd build
adb shell "mkdir -p /data/local/tmp/mems"
adb push ./scanner /data/local/tmp/mems/
adb push ../frontend/build /data/local/tmp/mems/
echo [ADB] Files pushed into AVD.
echo [ADB] Getting root access.
adb root
adb wait-for-device
echo "cd /data/local/tmp/mems && chmod +x scanner && ./scanner"
echo [ADB] Emulator booting up, running adb shell.
adb shell
REM Function to cleanup and exit emulator
echo [Cleanup] Cleaning up and exiting emulator...
adb emu kill
exit /b