-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Working for Android
To build your raylib game for Android you need a set of Android tools. Those tools are basically the Android SDK and Android NDK, including Android Platform Tools and also Java Runtime.
NOTE: For alternative instructions, check Working for Android (on macOS).
- Java 8 JDK and JRE
- Android SDK, just required the command line tools
We will use the SDKManager to install all required tools
To compile raylib sources, it's recommended to use Android NDK standalone toolchain.
You can build the toolchain with this command:
python %ANDROID_NDK%\build\tools\make_standalone_toolchain.py --arch arm --api 16 --install-dir=C:\android_toolchain_arm_api16
After that, just navigate from command line to folder raylib/src/
and execute Makefile with:
mingw32-make PLATFORM=PLATFORM_ANDROID
Remember to setup ANDROID_NDK
, ANDROID_TOOLCHAIN
property properly in the Makefile!
ANDROID_NDK = C:/android-sdk/ndk-bundle
ANDROID_TOOLCHAIN = C:/android_toolchain_arm_api16
NOTE: libraylib.a will be generated in folder `raylib/release/android/armeabi-v7a/.
Step 1. To build an APK, navigate to folder raylib/template/simple_game/
and edit Makefile.Android. Replace these
settings with yours where apropriate:
ANDROID_HOME = C:/android-sdk
ANDROID_NDK = $(ANDROID_HOME)/ndk-bundle
ANDROID_TOOLCHAIN = C:/android_toolchain_arm_api16
ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/26.0.3
ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools
JAVA_HOME = C:/PROGRA~1/Java/jdk1.8.0_152
Then build the apk with:
mingw32-make PLATFORM=PLATFORM_ANDROID
Step 2: To install the APK into connected device (previously intalled drivers and activated USB debug mode on device):
%ANDROID_SDK_TOOLS%\adb install -r simple_game.apk
Step 4: To view log output from device:
%ANDROID_SDK_TOOLS%\adb logcat -c
%ANDROID_SDK_TOOLS%\adb -d logcat raylib:V *:S
If you have any doubt, just let me know.
www.raylib.com | itch.io | GitHub | Discord | YouTube
- Architecture
- Syntax analysis
- Data structures
- Enumerated types
- External dependencies
- GLFW dependency
- libc dependency
- Platforms and graphics
- Input system
- Default shader
- Custom shaders
- Coding conventions
- Integration with other libs
- Working on Windows
- Working on macOS
- Working on GNU Linux
- Working on Chrome OS
- Working on FreeBSD
- Working on Raspberry Pi
- Working for Android
- Working for Web (HTML5)
- Working on exaequOS Web Computer
- Creating Discord Activities
- Working anywhere with CMake
- CMake Build Options
- raylib templates: Get started easily
- How To: Quick C/C++ Setup in Visual Studio 2022, GCC or MinGW
- How To: C# Visual Studio Setup
- How To: VSCode
- How To: Eclipse
- How To: Sublime Text
- How To: Code::Blocks