From b055f9b77074a316e366e0c5922727de976c344b Mon Sep 17 00:00:00 2001 From: John Grub Date: Tue, 10 Jun 2014 16:45:40 -0700 Subject: [PATCH] Updated Compilation guide (android from windows) (markdown) --- Android-compilation-guide-(from-linux).md | 37 ++++++++++++ Compilation-guide-(android-from-windows).md | 62 --------------------- 2 files changed, 37 insertions(+), 62 deletions(-) create mode 100644 Android-compilation-guide-(from-linux).md delete mode 100644 Compilation-guide-(android-from-windows).md diff --git a/Android-compilation-guide-(from-linux).md b/Android-compilation-guide-(from-linux).md new file mode 100644 index 0000000..b8bd060 --- /dev/null +++ b/Android-compilation-guide-(from-linux).md @@ -0,0 +1,37 @@ +## Prerequisites + +You need a complete android development environment ready to develop native apps. That means: +* Android SDK +* Android NDK + +Use Google to figure out how to install that and make sure the appropriate executables from the above are in your path variable. + +## Building libretro cores +```bash +git clone https://github.com/libretro/libretro-super.git +cd libretro-super +./libretro-fetch.sh # can fail on fork() calls, repeat until all are up to date +./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. +```bash +cd retroarch/android/phoenix +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` +```bash +mkdir -p assets/cores +cp ../../../dist/android/armeabi-v7a/* assets/cores/ #replace armeabi-v7a here by mips or x86 for those targets +cp -r ../../../dist/info/ assets/ +ant clean +ant debug +``` +If all goes well, this will spit out an .apk, `bin/retroarch-debug.apk`. Put it on your device with +```bash +adb -d install bin/retroarch-debug.apk +``` +Use `install -r` if you're reinstalling over an existing install. \ No newline at end of file diff --git a/Compilation-guide-(android-from-windows).md b/Compilation-guide-(android-from-windows).md deleted file mode 100644 index 336a959..0000000 --- a/Compilation-guide-(android-from-windows).md +++ /dev/null @@ -1,62 +0,0 @@ -## Prerequisites - -You need a complete android development environment ready to develop native apps. That means: -* Cygwin -* Android SDK -* Android NDK -* Eclipse with appropriate plugins - -Use Google to figure out how to install all that. Everything in this page happens in a Cygwin shell and in Eclipse. -Make sure you set NDK_ROOT to the path to your NDK and add that to your PATH in the Cygwin shell. For example, edit your .bashrc to add these lines: -```bash -export NDK_ROOT=/cygdrive/d/Dev/Libs/Android/android-ndk-r8e -export PATH=$NDK_ROOT:$PATH -``` - -## Building libretro cores -```bash -git clone https://github.com/libretro/libretro-super.git -cd libretro-super -./libretro-fetch.sh # can fail on fork() calls, repeat until all are up to date -./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. -```bash -cd retroarch/android/native -ndk-build clean APP_ABI="armeabi-v7a mips x86" -ndk-build APP_ABI="armeabi-v7a mips x86" APP_PLATFORM=android-17 # build native libs -cd ../phoenix -cp -R ../native/libs/* libs # copy native libs -cp -R ../../../dist/android/* libs # copy libretro cores -``` -When you need to rebuild the native code, run this from retroarch/android/native: -```bash -ndk-build APP_ABI="armeabi-v7a mips x86" APP_PLATFORM=android-17 -cp -R -f libs/* ../phoenix/libs -``` - -## Building the .apk -You can choose to use the Eclipse gui or the command line tool `ant` -### Building with ant -From the android/phoenix directory in the RetroArch repo: -```bash -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` -```bash -ant clean -ant debug -``` -If all goes well this will spit out an .apk, `bin/retroarch-debug.apk`. Put it on your device with -```bash -adb -d install bin/retroarch-debug.apk -``` - -### Building with eclipse -In Eclipse, set your workspace root to .../RetroArch/android. Then do "Import... - General - Existing Projects into Workspace" to get the native and phoenix projects in your workspace. I also copied the project.properties from phoenix to native, and created a src directory in native, to stop Eclipse from complaining, but that may just be because I'm using a really old version. - -Then, when you want to deploy to your device (make sure USB debugging is enabled) right-click on the phoenix project and select "Run As - Android Application" or use Debug to attach the debugger. When the native libs change I will tend to Clean before doing Run, to make sure the libs were repackaged in the apk. Google for more info about running and debugging Android apps in Eclipse. \ No newline at end of file