Getting Started¶
This page is the developer-side reference — clone, build, install, run, and test. For end-user documentation see the Lightnet docs hub.
Clone¶
The project uses the Gradle wrapper (gradlew.bat / ./gradlew) — no separate Gradle install needed.
Prerequisites¶
- Android SDK with API 24+ platform installed
- Android NDK (Android Studio → SDK Manager → SDK Tools → NDK)
- lightnet-firmware checkout — sibling at
../lightnet-firmware, or setlightnetFirmwareDirin a gitignoredlocal.propertiesat the repo root (seecomposeApp/src/androidMain/cpp/README.md) - A connected device or an emulator
- Xcode 14+ on macOS
- lightnet-firmware checkout + per-arch static lib build (see
composeApp/src/iosMain/README.md) - A simulator or physical device
Build commands¶
:: Build debug APK
.\gradlew.bat :composeApp:assembleDebug
:: Build and install on the connected Android device
.\gradlew.bat :composeApp:installDebug
:: Run all tests (commonTest — protocol layer unit tests)
.\gradlew.bat :composeApp:allTests
:: Run a single test class
.\gradlew.bat :composeApp:testDebugUnitTest --tests "com.lightnet.protocol.MessageProtocolTest"
:: Clean build outputs
.\gradlew.bat clean
# Build debug APK
./gradlew :composeApp:assembleDebug
# Build and install on the connected Android device
./gradlew :composeApp:installDebug
# Run all tests (commonTest — protocol layer unit tests)
./gradlew :composeApp:allTests
# Run a single test class
./gradlew :composeApp:testDebugUnitTest --tests "com.lightnet.protocol.MessageProtocolTest"
# Clean build outputs
./gradlew clean
The debug APK is written to composeApp/build/outputs/apk/debug/composeApp-debug.apk.
Run¶
- Connect an Android device (API 24+) or start an emulator
./gradlew :composeApp:installDebug(or.\gradlew.baton Windows)- Launch the Lightnet app on the device
mDNS on emulators
Device discovery via mDNS does not work reliably on Android emulators (multicast is blocked). Use a real device on the same Wi-Fi as the controller, or enable the demo device below.
- Open
iosApp/iosApp.xcodeprojin Xcode - Run the
iosAppscheme on a simulator or device - The KMP shared module compiles automatically as part of the Xcode build phase
Demo device — develop without hardware¶
No controller required
Open Settings (gear icon on the device list), turn on Enable demo device, then tap the Demo entry at the top of your device list. Adjust the virtual panel count in Settings while the demo is enabled. It connects to DemoConnector — a self-contained fake controller that responds with properly encoded, CRC-correct protocol packets. Every UI flow exercises the full protocol path, including encode/decode, so it's also the recommended harness for testing domain logic.
- Development — code structure and key conventions
- Connectivity — protocol details and device discovery