Compiling ScummVM/Android

From ScummVM :: Wiki
< Compiling ScummVM
Revision as of 06:10, 27 July 2020 by Praetorian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Compiling ScummVM for Android

This page describes how to build Android packages from the ScummVM source tree.

Please note that information on this page may be outdated; The Optional Libraries section in particular needs updating.

Mandatory tools

Android SDK Manager from Android Studio or from Command line tools -

Use the SDK Manager to install:

  • Platform tools
  • Build Tools 29.0.3
  • SDK Platform API 29
  • NDK 21.3.6528147 (r21d)

Set the ANDROID_SDK_ROOT environment variable to the root directory of the SDK, and ANDROID_NDK_ROOT to the root directory of the NDK - default installation: ${ANDROID_SDK_ROOT}/ndk/21.3.6528147

Optional libraries

  • Tremor (lowmem branch) to play .ogg audio files
  • MAD to play .mp3 audio files
  • FLAC to play lossless .flac files

Again, you have two options:

Precompiled binaries

Get this archive and extract it to e.g. /opt/android.

Build the libraries yourself

Warning: this sections is not yet updated for new Android toolchain

Here's a a simple script to set up a shell for crosscompiling for arm-v7a:


export CC=${PREFIX}gcc
export CXX=${PREFIX}g++
export AS=${PREFIX}gcc
export LD=${PREFIX}gcc
export AR=${PREFIX}ar cru
export RANLIB=${PREFIX}ranlib
export STRIP=${PREFIX}strip
export OBJCOPY=${PREFIX}objcopy
export CPP=${PREFIX}cpp

export MACHDEP="--sysroot=$ANDROID_NDK/platforms/android-4/arch-arm -g -mandroid -mthumb-interwork"

export CFLAGS="${MACHDEP} -Os -Wall -mandroid -msoft-float -march=armv5te -mtune=xscale"



echo "./configure --host=arm --prefix=/opt/android/3rd-android-4-armeabi"

Save it to a file (like and run

. ./

in your shell. Build systems should now use the correct tools.


Get a SVN checkout (r17852. as of this writing):

svn co

configure it:

./ --host=arm --prefix=/opt/android/3rd-android-4-armeabi --enable-low-accuracy --enable-64kHz-limit

and finally build & install it:

make install


Get a tarball of the latest stable version here (v0.15.1b as of this writing) and extract it.

configure it:

./ --host=arm --prefix=/opt/android/3rd-android-4-armeabi --enable-speed --enable-fpm=arm --disable-aso

and finally build & install it:

make install


Get a tarball of the latest stable version here (v1.2.1 as of this writing) and extract it.

configure it:

./configure --prefix=/opt/android/3rd-android-4-armeabi --disable-largefile --disable-thorough-tests --disable-doxygen-docs --disable-xmms-plugin --disable-cpplibs --disable-ogg --disable-oggtest --disable-rpath

and build & install the required parts:

make -C src/libFLAC
make -C src/libFLAC install
make -C include install


The Android port can be compiled with the configure script.

The most basic way to accomplish this is to run:

./configure --host=android-arm-v7a

The script supports various arguments, which you can use to en- or disable features, see ./configure --help.

If you want support for additional libraries, you need cross-compiled binaries. If you followed the above description and have those libraries in /opt/android/3rd-android-4-armeabi, the configure command line would look like this:

./configure --host=android-arm-v7a --with-tremor-prefix=/opt/android/3rd-android-4-armeabi --with-mad-prefix=/opt/android/3rd-android-4-armeabi --with-flac-prefix=/opt/android/3rd-android-4-armeabi

Supported hosts:

  • android-arm-v7a - for older Android devices
  • android-arm64-v8a - for all new Android devices
  • android-x86 - ideal for emulator with 32bit images
  • android-x86_64 - ideal for emulator with 64bit images

Android Studio setup

After compiling there in the build directory (if used) there will be a new directory called android-project, this can be opened by Android Studio. C files are not yet available, but it is possible to edit the Java source files and debug both Java & native code (in emulator or on a real device via adb connection). To enable debugging, after opening the android-project directory change Project configuration, under tab Debugger, set field Debug type to Dual