- flake.nix: devShells.default (JDK 17 + Android SDK 34 / NDK 27.0.12077973 + Gradle) and packages.moonlight-android (assembleNonRootDebug via gradle mitmCache) - deps.json: offline Maven lockfile (195 artifacts) - nix-deps-fixup.gradle: skip androidTest variant ambiguity during dep capture - README: Building with Nix section
3.1 KiB
Moonlight Android
Moonlight for Android is an open source client for NVIDIA GameStream and Sunshine.
Moonlight for Android will allow you to stream your full collection of games from your Windows PC to your Android device, whether in your own home or over the internet.
Moonlight also has a PC client and iOS/tvOS client.
You can follow development on our Discord server and help translate Moonlight into your language on Weblate.
Downloads
Building
- Install Android Studio and the Android NDK
- Run ‘git submodule update --init --recursive’ from within moonlight-android/
- In moonlight-android/, create a file called ‘local.properties’. Add an ‘ndk.dir=’ property to the local.properties file and set it equal to your NDK directory.
- Build the APK using Android Studio or gradle
Building with Nix
A flake.nix provides a reproducible dev environment and a fully hermetic
debug-APK build (Android SDK 34, NDK 27.0.12077973, Gradle, JDK 17). All
commands need ?submodules=1 so the moonlight-common-c + enet submodule
sources are included in the build.
# Dev shell: ANDROID_HOME / ANDROID_NDK_ROOT / JAVA_HOME + gradle, then build by hand
nix develop '.?submodules=1'
./gradlew assembleNonRootDebug
# Hermetic, offline build of the nonRoot debug APK (output in ./result/)
nix build '.?submodules=1#moonlight-android'
ls result/app-nonRoot-debug.apk
Maven dependencies are pinned in deps.json (a Nixpkgs Gradle mitm-cache
lockfile). Regenerate it after changing dependencies:
nix build '.?submodules=1#moonlight-android.mitmCache.updateScript' && ./result
Notes:
- If your Nix is configured to offload to a remote builder, add
--builders ""to build locally instead of copying the multi-GB SDK closure to the remote. - The build targets the
nonRootdebugvariant; it is signed with the generated Android debug keystore (not a release key).
Authors
Moonlight is the work of students at Case Western and was started as a project at MHacks.