A clean, reusable scaffold for building games using the Odin Programming Language and Raylib, with first-class support for compiling to Desktop (Linux/Windows) and Android.
- Entry Point: The game entry point is located in
src/main.odin. - Zero-Conf Build: Simple
Makefileto handle build commands. - Android Ready: Pre-configured
build_android.shscript handling C/Odin cross-compilation, linking, APK packaging, and signing. - Raylib 5.0: Includes precompiled static libraries for Android (
arm64-v8a,armeabi-v7a).
Ensure you have the latest Odin compiler installed and in your PATH.
You need the Android SDK and NDK installed to compile for mobile. You can install these via Android Studio or command-line tools.
Required Environment Variables:
Add these to your shell config (.bashrc / .zshrc):
export ANDROID_HOME="/path/to/android/sdk" # e.g., /opt/android-sdk or ~/Android/Sdk
export ANDROID_NDK_HOME="/path/to/android/ndk" # e.g., /opt/android-ndk or $ANDROID_HOME/ndk/25.x.xYou will need adb installed and in your PATH for signing, packaging, and deploying the APK files.
- Included with Android SDK Platform-Tools.
You can easily rename the project by editing the NAME variable in the Makefile.
# Makefile
NAME = my_cool_gameCompiles and runs the game natively on your machine.
make runArtifacts are saved to build/.
Compiles the Odin code, links it with the Android native glue, and packages an APK.
make androidThe signed APK is saved to build/game.apk.
If your phone is connected via USB or Wi-Fi debugging:
make installNo USB cable? No problem.
- On Phone: Go to Developer Options > Wireless Debugging.
- Tap Pair device with pairing code to see IP, Port, and Code.
- On PC: Run pair command:
adb pair 192.168.1.X:PORT # Enter the 6-digit code when prompted - Connect: Look at the main "Wireless debugging" screen for the connect port (it differs from the pair port).
adb connect 192.168.1.X:PORT
- Deploy: Run
make install.
.
├── src/ # 📝 YOUR GAME CODE
│ └── main.odin # Main entry point (Desktop & Android logic)
├── assets/ # 🎨 Images, Sounds, Icons
├── android/ # 🤖 Android specific sources
│ ├── AndroidManifest.xml
│ └── src/ # Java loader (NativeActivity)
├── lib/ # 📚 Precompiled Raylib Android Libraries
├── include/ # 📄 Raylib header files
├── build_android.sh # ⚙️ The magic script for Android compilation
└── Makefile # 🛠️ Main task runner
- "Linker name 'main' reserved": This template uses a linker flag (
-Wl,--defsym=main=android_entry) inbuild_android.shto map Odin's entry point to C'smain. Do not change the procedure nameandroid_entryinsrc/main.odinwithout updating the script. - "Standard library not found": Ensure your
ANDROID_NDK_HOMEpath is correct.