Skip to content

Instantly share code, notes, and snippets.

@zorgsoft
Forked from Calinou/build_android.bat
Created November 14, 2017 17:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zorgsoft/1cf877b573153f88171babae584c4b92 to your computer and use it in GitHub Desktop.
Save zorgsoft/1cf877b573153f88171babae584c4b92 to your computer and use it in GitHub Desktop.
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