| name | run-android |
| description | Build, launch, and drive the notes app natively on Android (React Native hosted in .NET MAUI). Use when running or building the Android app, booting the emulator, or driving/screenshotting its UI. |
Run on Android
Native React Native (no WebView) hosted in .NET MAUI via a Java bridge, talking to the in-process
backend over 127.0.0.1:5001. Prereqs: JDK 17, the Android SDK (platform + build-tools 36, NDK
27.1.12297006) with ANDROID_HOME set, and an emulator or device.
Build and run
Pick the ABI that matches the target: arm64-v8a (Apple-silicon emulator / most phones) or x86_64
(Intel emulator / CI). Run in order from the repo root:
./src/Client.MAUI/Scripts/build-rn-android.sh --abi=<abi>. Done when src/Client.MAUI/Frameworks/Android/ holds libs/, jniLibs/<abi>/, and app-classes.jar.
./src/Client.MAUI/Scripts/bundle-js.sh --android. Done when src/Client.MAUI/Resources/Raw/index.android.bundle exists.
- Boot an emulator if none is running (
emulator -avd <name>); wait until adb shell getprop sys.boot_completed returns 1.
./src/Client.MAUI/Scripts/e2e-android.sh. This builds -f net10.0-android, installs a fresh copy, launches, and proves the round-trip. Done when it prints Android end-to-end test PASSED.
The e2e script handles two Android traps for you: it builds with EmbedAssembliesIntoApk=true (a plain
adb install of a Debug APK otherwise boots with no managed assemblies), and it launches with
am start on the dynamically-resolved activity (MAUI CRC64-mangles the name, and monkey can exit
without launching).
Drive or screenshot the running UI
RN testID becomes the Android resource-id, so uiautomator can drive the app:
- Dump the tree:
adb -s <serial> shell uiautomator dump /sdcard/ui.xml && adb -s <serial> shell cat /sdcard/ui.xml.
- Add a note: find
notes.text.input / notes.add.button by their node bounds, then adb -s <serial> shell input tap <cx> <cy> and adb -s <serial> shell input text 'Buy%sgroceries' (%s = space).
- Screenshot:
adb -s <serial> exec-out screencap -p > shot.png.