This project demonstrates using xmake to build raylib-cpp based projects and compile them for Android platform as APK files.
- Android NDK: Android NDK installation required (NDK r27d verified)
- Android SDK: Full Android SDK required (for APK packaging)
- Includes build-tools (aapt, zipalign, apksigner, etc.)
- Includes platform (android.jar)
- Java Development Kit: JDK 17 or higher required for Android tools
- xmake: Ensure latest version of xmake is installed
Automated Android Environment Setup
This project provides an automated script to set up the Android development environment:
You can directly configure xmake with your existing Android tools:
# Configure xmake with your existing paths
xmake g --ndk=[YOUR_NDK_PATH]
xmake g --android_sdk=[YOUR_ANDROID_SDK_PATH]
# Then proceed with normal build process
xmake config -p android -a arm64-v8a -m release
xmake
xmake install -o build cppray
xmake run cpprayThe project includes an automated setup script that will download and install all required components:
# Run the automated setup script
xmake lua setup_android.lua
# The script will:
# 1. Check for Java environment, install if missing (using system package managers)
# 2. Download and install Android NDK r21e
# 3. Download and install Android SDK Command-line Tools
# 4. Install required SDK components (platforms;android-35, build-tools;35.0.0, platform-tools)
# 5. Configure xmake global settings automaticallyAfter running the setup script, you can proceed with the normal build process as described below.
# Configure Android build
xmake config -p android -a arm64-v8a -m release
# Build project
xmake
# Package APK
xmake install -o build cppray
# Install and run APK # uses adb
xmake run cpprayThis project includes GitHub Actions workflows that automatically build multi-platform versions:
- Android: arm64-v8a, armeabi-v7a
- Windows: x64
- Linux: x86_64
- macOS: x86_64
Visit the repository's Actions page to check build status and download build artifacts.
Pushing version tags (e.g. v1.0.0) will automatically trigger the release process:
git tag v1.0.0
git push origin v1.0.0See CI/CD Documentation for details.