forked from gameplay3d/gameplay
-
Notifications
You must be signed in to change notification settings - Fork 1
Android NDK Setup
dgough edited this page Jan 3, 2013
·
10 revisions
This page explains how to compile gameplay for Android devices on Windows 7.
- Download and install the Android SDK.
- Make sure
<android-sdk-path>/tools
and<android-sdk-path>/platform-tools
are added to PATH.
- Download and install the Android NDK.
- Follow these instructions.
- Make sure
<android-ndk-path>
is added to PATH.
- Download and install Apache Ant.
- Make sure
<ant-path>/bin
is added the PATH.
- Download and install Cygwin
- Select and add the package
make: The GNU version of the 'make' utility
during installation. - Rename awk.exe to something else (awk_.exe for example) in
<android-ndk-path>/prebuilt/windows/bin
. This is to prevent the Android build system from being confused by the cygwin's awk.
- Open the Cygwin terminal.
- Change directory to
<gameplay-root>/gameplay/android
- Run the following command to generate the needed files to build the project:
android.bat update project -t 1 -p . -s
- Build the gameplay library:
ndk-build
- Open the Cygwin terminal.
- Change directory to
<gameplay-root/gameplay-samples/sampleXX-XXXXX>/android
- Run this command to generate the needed files to build the project:
android.bat update project -t 1 -p . -s
- Build the gameplay sample:
ndk-build
Make sure developer mode is enabled and USB debugging is turned on.
- Change directory to
<gameplay-root/gameplay-samples/sampleXX-XXXXX>/android
- Install the app:
ant debug install
If ant debug install
does not work, ensure your device is being detected properly by running adb devices
. If no devices are reported, try downloading the correct USB drivers from you phone manufacturer's website. (OEM Drivers)
If you see an error like ./obj/local/armeabi/libpng.a: No such file: Permission denied
, make sure that the *.a
files have read permission by running:
chmod +r obj/local/armeabi/*.a