Skip to content

Instantly share code, notes, and snippets.

@roman-yagodin
Forked from Calinou/build_android.sh
Created September 23, 2016 09:43
Show Gist options
  • Save roman-yagodin/5f39956987c9982ba0b1671d1ab431a1 to your computer and use it in GitHub Desktop.
Save roman-yagodin/5f39956987c9982ba0b1671d1ab431a1 to your computer and use it in GitHub Desktop.
Compile Godot for Android easily
#!/bin/sh -x
# This script compiles Android debug and release templates from a Godot Git clone.
# It needs to be run from a GNU/Linux system. The compilation process will automatically
# use all CPU threads available.
# You will need to install Android SDK (API 19) and NDK (latest, as of May 2016).
# Place this script at the root of your Godot Git clone.
# CC0 1.0 Universal
# Change those to the path of Android SDK and NDK
export ANDROID_HOME="/opt/android-sdk"
export ANDROID_NDK_ROOT="/opt/android-ndk"
# Build Godot for Android in debug and release mode
scons p=android -j$(nproc) colored=yes tools=no target=release_debug
scons p=android -j$(nproc) colored=yes tools=no target=release
# Create APK using Gradle
cd platform/android/java
./gradlew build
# Copy to export templates directory
cd ../../../bin/
cp android_debug.apk android_release.apk $HOME/.godot/templates/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment