mirror of
https://github.com/TwilitRealm/dusklight.git
synced 2026-05-13 12:28:06 -07:00
79b1f4ab4d
* Customizable data directory & migration * Add file/dir rename fast-path * Write data_location.json to base path on Windows; fix UTF-8 custom paths * Build fix * Another build fix * Android data directory selection * Fix CMake target ref
Android Shell
This directory contains a minimal SDLActivity-based Android app wrapper for Dusklight.
Prerequisites
- Android SDK installed (
ANDROID_HOME) - Android NDK version used by CMake presets (
ANDROID_NDK_VERSION) - JDK 17+
Example:
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_NDK_VERSION="29.0.14206865"
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk"
Build Native Libraries
cmake --preset android-arm64
cmake --build --preset android-arm64
cmake --preset android-x86_64
cmake --build --preset android-x86_64
These builds produce:
build/android-arm64/Binaries/libmain.sobuild/android-x86_64/Binaries/libmain.so
Stage Libraries Into APK Project
./android/scripts/stage-jni-libs.sh
This copies:
libmain.so->android/app/src/main/jniLibs/arm64-v8a/libmain.so->android/app/src/main/jniLibs/x86_64/
Refresh SDL Java Shim (Optional)
If you update SDL and want to refresh the embedded Java shim files:
./android/scripts/sync-sdl-java.sh
Build APK
cd android
./gradlew :app:assembleDebug
Output APK:
android/app/build/outputs/apk/debug/app-debug.apk
Launch With Runtime Args (adb)
You can pass command-line args through the activity intent:
adb shell am start -n dev.twilitrealm.dusk/.DuskActivity \
--es dusk_args "--backend vulkan"
Supported extras:
dusk_args: single shell-like argument stringdusk_argv: string-array argv