These instructions are written for a 64-bit Ubuntu installation. Modifying them for other linux distributions should be little to no work. If you're running Windows you're on your own.
- Download and extract the Android SDK tools: https://developer.android.com/studio/index.html#command-tools
- Download and extract the Android NDK (r19c or later): https://developer.android.com/ndk/downloads
- Install JDK 8. Required by Android SDK manager.
- Install
bisonandflex. Used by the native nethack build. - Check out NetHack-Android:
git clone https://github.com/gurrhack/NetHack-Android.git - Create an env variable called
ANDROID_SDK_ROOTand point it to the android-sdk installation directory. Used by Gradle.
cd /path/to/android-sdk/tools/bin- Update the sdk manager:
./sdkmanager --update. If you get "NoClassDefFoundError" it's because you're not running JDK 8. Make sure the env variableJAVA_HOMEpoints to JDK 8. - Install the platform tools:
./sdkmanager --install "platforms;android-30"
cd /path/to/NetHack-Android/sys/android- Open
Makefile.srcand change NDK to the appropriate path. sh ./setup.shcd ../..make install
cd /path/to/NetHack-Android/sys/android./gradlew buildcd ./app/build/outputs/apk/debug- Copy the APK file from this directory to your device.
- On your device: locate the APK file, install it and run!
Happy hacking!