Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compile Godot for Android easily (on Windows)
:: This script must be run from a Windows machine with
:: Android SDK and NDK installed.
:: NOTE: You need Pywin32 to be installed to use multi-threaded compilation.
:: You may need to set "threads" to 1 for the first build, even if you have it installed.
:: Place this script at the root of your Godot Git clone.
:: CC0 1.0 Universal
set threads=%NUMBER_OF_PROCESSORS%
:: Set paths to MinGW, Android SDK and Android NDK
set PATH=%PROGRAMFILES%\mingw-w64\x86_64-6.2.0-posix-seh-rt_v5-rev0\mingw64\bin\;%PATH%
set ANDROID_HOME=%LOCALAPPDATA%\Android\android-sdk
set ANDROID_NDK_ROOT=%LOCALAPPDATA%\Android\android-ndk
:: Build Godot for Android
call "C:\Python27\Scripts\scons.bat" p=android -j%threads% verbose=no tools=no target=release_debug
call "C:\Python27\Scripts\scons.bat" p=android -j%threads% verbose=no tools=no target=release
:: Package it into an APK
cd platform/android/java
call "gradlew.bat" build
:: Copy APKs in user's export templates folder
cd ../../../bin
copy android_debug.apk %APPDATA%\Godot\templates\android_debug.apk
copy android_release.apk %APPDATA%\Godot\templates\android_release.apk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.