A Godot 4 game running in portrait at 720 by 1280: a walker on a path under a lantern, titled Lantern Walk

Godot will export to Android. It will also spend a long time telling you, at the end, that the keystore is missing, the window is landscape, or the export path is a folder. This walkthrough sets portrait mode, writes a debug keystore, fills in an Android preset, and runs Ship Check (Godot Export CI MCP) on that preset so the obvious mistakes show up before you wait on a failed export.

The portrait shot above is a real Godot 4.3 run of a tiny project called Lantern Walk, viewport 720 by 1280, with display/window/handheld/orientation set to 1 (portrait). The preset checks ran in the same project.

1. Make the game portrait first

Set the window to the phone, not the other way around. In Project Settings:

  • Display > Window > Size > Viewport Width: 720
  • Display > Window > Size > Viewport Height: 1280
  • Display > Window > Handheld > Orientation: Portrait (the value is 1)

In project.godot that looks like this:

[display] window/size/viewport_width=720 window/size/viewport_height=1280 window/handheld/orientation=1 

If you only change the Android export later, the editor will keep showing a landscape game, and you will only notice the crop once the APK is on a phone. I printed the live settings from the running scene: orientation=1 viewport=720x1280. The screenshot is that window.

2. Make a debug keystore

Android will not sign an APK without a keystore. For local debug builds, keytool (from a JDK) is enough. I ran this and got a JKS keystore with one entry, alias androiddebugkey:

keytool -genkeypair -storetype JKS -keystore keystore/debug-tutorial.keystore \ -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 10000 \ -storepass android -keypass android \ -dname "CN=Tutorial, OU=Dev, O=Local, L=Local, ST=NA, C=US" \ -noprompt 

Use your own passwords for anything you will ship. This one follows the usual debug alias and password so it is obvious it is a local tutorial keystore. Keep the file out of public repos. keytool -list on the file I generated reported type JKS and a single PrivateKeyEntry.

3. Write the Android preset

Project > Export > Add > Android. Give it a file path that ends in .apk, not a folder. Turn on arm64-v8a. Use a package name that is only lowercase letters, digits and dots.

The preset I validated looks like this (the [preset.0.options] block is the Android-specific half):

[preset.0] name="Android" platform="Android" runnable=true export_path="build/android/lantern-walk.apk" [preset.0.options] architectures/armeabi-v7a=false architectures/arm64-v8a=true architectures/x86=false architectures/x86_64=false keystore/debug="keystore/debug-tutorial.keystore" keystore/debug_user="androiddebugkey" keystore/debug_password="android" package/unique_name="com.angelofcuriosity.lanternwalk" package/name="Lantern Walk" package/signed=true 

Two mistakes that waste an afternoon:

  • export_path set to build/android/ (a directory). The export has nowhere to put the APK.
  • A package name with a capital letter or a space. Android will refuse it later. com.angelofcuriosity.lanternwalk is boring, and boring is the goal.

Create the build/android/ folder if it does not exist yet, or let the export runner create it.

4. Validate the preset before you export

Ship Check reads export_presets.cfg and flags the problems it can see without starting a full Android build. I ran its validator headless in this project.

On the good preset above it reported: ok=true, one preset named Android, platform Android, path build/android/lantern-walk.apk, runnable, no errors, no warnings.

I then swapped in a broken file on purpose, with export_path="build/android/" and a second preset that had no name and no path. The same validator reported ok=false and three errors:

  • Android: export_path must be a file, not a directory
  • preset.1: missing name
  • preset.1: missing export_path

After I restored the good file, it reported ok=true again.

You can run that from the Ship Check dock (Validate presets) or the same way I did, with a tiny script that loads res://addons/godot_export_ci_mcp/preset_validator.gd and calls validate().

5. Then export

Once the Android export templates are installed and the Java SDK and Android SDK paths are set in Editor Settings, the export command is:

godot --headless --path . --export-release "Android" build/android/lantern-walk.apk 

That is the same command Ship Check's local runner uses (it also creates the output folder and writes .godot-export-ci/last-export.log). I did not finish an APK on this box: Godot 4.7.2 stopped with missing android_release.apk / android_debug.apk templates and no Java SDK or Android SDK path in Editor Settings. The portrait project, the keystore, and the preset checks above all ran. The templates and the two SDK paths are the remaining install on a machine that will actually sign an APK.

What I checked

  • Godot 4.3.stable, Compatibility renderer: scene ran at 720x1280, orientation 1, and wrote the portrait PNG above.
  • Godot 4.3.stable, headless: Ship Check validate() passed on the good Android preset and failed, with the three errors above, on the broken one. The good file was restored and passed again.
  • keytool created a JKS keystore at keystore/debug-tutorial.keystore with alias androiddebugkey.
  • A later export attempt in Godot 4.7.2 failed for missing Android templates and missing SDK paths in Editor Settings, which is recorded in the test notes. No APK was written.

Let the dock catch the typo first

The painful part of Android export is rarely the last click. It is finding out, after a long wait, that the path was a folder or the keystore was never created. Ship Check (Godot Export CI MCP) sits in the editor, checks the presets, and can run the local export for you. That is the tool I used on the preset in this post.

Ship Check's editor dock, from the product's store shots

Get it here: Ship Check (Godot Export CI MCP)

Questions: export-ci-mcp@darrellbest.com