Skip to content

Compilation guide (Android from Linux)

l3iggs edited this page Jul 25, 2014 · 8 revisions

Prerequisites

You need a complete android development environment ready to develop native apps. That means you have:

Use Google to figure out how to install that and make sure the appropriate executables from the above are in your path variable.
These instructions have been tested under Linux. They may also work in windows with cygwin.

Building libretro cores

git clone https://github.com/libretro/libretro-super.git
cd libretro-super
./libretro-fetch.sh              
NOCLEAN=1 ./libretro-build-android-mk.sh #omit NOCLEAN=1 if you'd like to perform make clean on every core before building each one

./libretro-fetch.sh can fail on fork() calls, repeat until all are up to date
For ./libretro-build-android-mk.sh, some cores may fail to compile (g++ "Argument list too long" error). See https://github.com/libretro/libretro-super/issues/10

Building RetroArch

The RetroArch repo is fetched into the libretro-super folder as retroarch by ./libretro-fetch.sh above.

cd retroarch/android/phoenix
android update project --path .
android update project --path libs/googleplay/
android update project --path libs/appcompat/

Now edit local.properties to point to the location of your ndk directory by adding a line like this: ndk.dir=/complete/path/to/android-ndk-r9d

mkdir -p assets/cores
mkdir assets/overlays
cp ../../../dist/android/armeabi-v7a/* assets/cores/ #replace armeabi-v7a here by mips or x86 for those targets
cp -r ../../../dist/info/ assets/
cp -r ../../../libretro-overlays/* assets/overlays/
ant clean
ant debug

If all goes well, this will spit out an .apk, bin/retroarch-debug.apk. Put it on your device with

adb install -r bin/retroarch-debug.apk

Clone this wiki locally