Museum of Lost Lights · Lesson 44 of 50 · Publishing · About 45 min
Your museum’s Android build is going to a test phone first. Treat it like a dress rehearsal and write down what succeeds before sending a build to any public store.

Download the projects from the course page. In Godot’s Project Manager, choose Import, select project.godot, and use Run Project (F5). Start from checkpoints/43 when the lesson builds on prior work, or copy the checkpoints/44 folder to try this lesson on its own. Read the file names in the steps before editing.

Build it step by step
Language and tools in this lesson Array[String], String.ends_with, if and else, functions that return String, APK and AAB, Android target API.
-
Open the checkpoint in Godot
Extract the course files. In Godot Project Manager, choose Import and point it to this lesson’s project.godot. Double-click main.gd in FileSystem to open the script. Press F6 to run the current scene once main.tscn is open, or F5 to run the project. The three buttons compare example filenames. They never open or upload files.
const UI = preload("res://lesson_ui.gd")Why it works This small project lets you see one release skill at a time. The finished Museum of Lost Lights is a second, independent project. Keep both projects in their own folders.
-
Choose the filename label the checker inspects
Read _describe and follow its path argument into the variable file_name. The checkpoint brings the letters to lowercase, then checks the end of the name with ends_with.
if file_name.ends_with(".aab"):Why it works A path is text. Lowercasing lets the same check accept an uppercase extension. The extension only tells you which kind of file this claims to be.
-
Prepare Godot’s Android tools
On your computer, install the Godot export templates, the Android SDK, and the supported JDK named in the official export guide. In Godot Editor Settings, search Android and fill the SDK and Java paths. In Project → Export, add an Android preset.
Why it works The templates build Godot’s app, the SDK supplies Android libraries, and the JDK supports the build tools. As checked in November 2026, Google Play requires API level 36 or higher for new phone apps and updates. Recheck the official target API page when you export.
-
Run an APK on a phone first
With help from the device owner, enable Android developer options and USB debugging for local testing. Connect your device and accept its pairing prompt. Run the Android build through Godot’s remote deployment or install your own exported debug APK on that test device. Replay the lesson 42 tests.
Why it works An APK can be installed as an Android app package. A debug build makes it easy to spot issues during development.
-
Set up the signed AAB
Ask the publishing adult to choose a unique package ID and an increased version code. In the Android preset, enable Use Gradle Build when required for bundle output, choose export format AAB, set the upload signing details as instructed by Godot, and export with debug switched off. Use Google Play App Signing when Play Console prompts for it.
Why it works A release bundle is the package that Play Console expects for a new phone app. Google Play generates the device-specific installation packages it delivers. Preserve the app ID and the publisher’s signing setup for updates.
-
Put the bundle in a test track
In Play Console, the adult can create an app, open the testing track, create a release, upload the AAB, name the release, add notes, review errors and roll out to the chosen testers. Start with internal testing, then use a closed test when required. For eligible personal accounts created after 13 November 2023, Google requires at least 12 testers opted in for 14 continuous days before applying for production access.
Why it works Uploading to a test track gives testers a copy of a real distribution build. The production-access application is a separate store decision.
-
Read the result, then apply it to your game
Record the actual app ID, version code and device outcomes outside the checkpoint. In your notes, label which package was tested and where. If you only used the local file checker today, register the device test as outstanding.
Why it works The checkpoint shows what to look for. Your game’s real result comes from testing your own build, assets and settings.
Watch the values change
-
Choose debug sample The extension is .apk.
What you see. The checker calls it an Android install package. -
Choose release sample The extension is .AAB, then lowercases.
What you see. The checker calls it a Play upload candidate. -
Choose wrong file The extension is .png.
What you see. The checker asks for a build file.
Predict before you run Can the checkpoint tell if a file named museum.aab contains a real signed app bundle?
Reveal the answer
No. It only examines the characters in the example filename. The Android export process and Play Console inspect the real build.
Complete checkpoint
The three buttons describe a debug APK, an AAB candidate and a non-build example. The checker works entirely offline.
main.gd
extends Control
const UI = preload("res://lesson_ui.gd")
var status: Label
func _ready() -> void:
var column := UI.build(self, "Android release practice", "Compare the example filenames. Test your own build with an adult.")
UI.button(column, "museum-debug.apk", _show.bind("museum-debug.apk"))
UI.button(column, "museum-release.AAB", _show.bind("museum-release.AAB"))
UI.button(column, "museum-cover.png", _show.bind("museum-cover.png"))
status = UI.message(column, "Waiting for a sample file name.")
func _show(path: String) -> void:
status.text = _describe(path)
func _describe(path: String) -> String:
var file_name := path.to_lower()
if file_name.ends_with(".aab"):
return "Play upload candidate. Verify the real signature and bundle in the release tools."
if file_name.ends_with(".apk"):
return "Android install package. Check whether your own test build uses a debug signature."
return "This example is not an Android build filename."
lesson_ui.gd
extends RefCounted
static func build(screen: Control, heading: String, opening: String) -> VBoxContainer:
var margins := MarginContainer.new()
screen.add_child(margins)
margins.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
for edge in ["left", "right", "top", "bottom"]:
margins.add_theme_constant_override("margin_" + edge, 24)
var scroll := ScrollContainer.new()
margins.add_child(scroll)
var column := VBoxContainer.new()
column.size_flags_horizontal = Control.SIZE_EXPAND_FILL
scroll.add_child(column)
column.add_theme_constant_override("separation", 12)
var title := Label.new()
title.text = heading
title.add_theme_font_size_override("font_size", 30)
column.add_child(title)
message(column, opening)
return column
static func message(column: VBoxContainer, text: String) -> Label:
var line := Label.new()
line.text = text
line.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
column.add_child(line)
return line
static func button(column: Container, caption: String, action: Callable) -> Button:
var control := Button.new()
control.text = caption
control.custom_minimum_size.y = 48
control.pressed.connect(action)
column.add_child(control)
return control
GDScript line by line
Follow the line numbers, including the indent at the start of each line. Find the code the game will run first, then look for the function that reacts when you tap or change something.
Read main.gd line by line
-
extends ControlStarts with Godot's Control type. This script gets the abilities of that type and adds the game's own rules. -
const UI = preload("res://lesson_ui.gd")Creates a constant named UI. The expression prepares a resource at a fixed project path when the script is loaded. -
var status: LabelDeclares status for later use. A colon followed by a type says which kind of value belongs here. -
func _ready() -> void:Godot calls this once after the scene and its children are ready. Use it to set up the room and connect controls. -
var column := UI.build(self, "Android release practice", "Compare the example filenames. Test your own build with an adult.")Creates a variable named column. The expression calls UI.build with the values in its parentheses. Godot infers the type from the first value. -
UI.button(column, "museum-debug.apk", _show.bind("museum-debug.apk"))Calls UI.button with the values in its parentheses. -
UI.button(column, "museum-release.AAB", _show.bind("museum-release.AAB"))Calls UI.button with the values in its parentheses. -
UI.button(column, "museum-cover.png", _show.bind("museum-cover.png"))Calls UI.button with the values in its parentheses. -
status = UI.message(column, "Waiting for a sample file name.")Stores the new value in status. The expression calls UI.message with the values in its parentheses. -
func _show(path: String) -> void:Defines show, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
status.text = _describe(path)Updates status.text, which controls the words a player sees. The expression calls _describe with the values in its parentheses. -
func _describe(path: String) -> String:Defines describe, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var file_name := path.to_lower()Creates a variable named file_name. The expression calls path.to_lower with the values in its parentheses. Godot infers the type from the first value. -
if file_name.ends_with(".aab"):Checks file_name.ends_with(".aab"). The indented instructions below run only if this test passes. -
return "Play upload candidate. Verify the real signature and bundle in the release tools."Finishes the function and hands its result back to the caller. The expression uses the text inside the quotes. -
if file_name.ends_with(".apk"):Checks file_name.ends_with(".apk"). The indented instructions below run only if this test passes. -
return "Android install package. Check whether your own test build uses a debug signature."Finishes the function and hands its result back to the caller. The expression uses the text inside the quotes. -
return "This example is not an Android build filename."Finishes the function and hands its result back to the caller. The expression uses the text inside the quotes.
Read lesson_ui.gd line by line
-
extends RefCountedStarts with Godot's RefCounted type. This script gets the abilities of that type and adds the game's own rules. -
static func build(screen: Control, heading: String, opening: String) -> VBoxContainer:Defines build, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var margins := MarginContainer.new()Creates a variable named margins. The expression creates a new MarginContainer object. Godot infers the type from the first value. -
screen.add_child(margins)Adds the new node to the scene tree so that Godot can run and draw it. -
margins.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)Positions this Control relative to the bounds of its parent. -
for edge in ["left", "right", "top", "bottom"]:Repeats the indented instructions for each value in ["left", "right", "top", "bottom"]. -
margins.add_theme_constant_override("margin_" + edge, 24)Calls margins.add_theme_constant_override with the values in its parentheses. -
var scroll := ScrollContainer.new()Creates a variable named scroll. The expression creates a new ScrollContainer object. Godot infers the type from the first value. -
margins.add_child(scroll)Adds the new node to the scene tree so that Godot can run and draw it. -
var column := VBoxContainer.new()Creates a variable named column. The expression creates a new VBoxContainer object. Godot infers the type from the first value. -
column.size_flags_horizontal = Control.SIZE_EXPAND_FILLStores the new value in column.size_flags_horizontal. The expression reads Control.SIZE_EXPAND_FILL. -
scroll.add_child(column)Adds the new node to the scene tree so that Godot can run and draw it. -
column.add_theme_constant_override("separation", 12)Calls column.add_theme_constant_override with the values in its parentheses. -
var title := Label.new()Creates a variable named title. The expression creates a new Label object. Godot infers the type from the first value. -
title.text = headingUpdates title.text, which controls the words a player sees. The expression reads heading. -
title.add_theme_font_size_override("font_size", 30)Calls title.add_theme_font_size_override with the values in its parentheses. -
column.add_child(title)Adds the new node to the scene tree so that Godot can run and draw it. -
message(column, opening)Calls message with the values in its parentheses. -
return columnFinishes the function and hands its result back to the caller. The expression reads column. -
static func message(column: VBoxContainer, text: String) -> Label:Defines message, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var line := Label.new()Creates a variable named line. The expression creates a new Label object. Godot infers the type from the first value. -
line.text = textUpdates line.text, which controls the words a player sees. The expression reads text. -
line.autowrap_mode = TextServer.AUTOWRAP_WORD_SMARTStores the new value in line.autowrap_mode. The expression reads TextServer.AUTOWRAP_WORD_SMART. -
column.add_child(line)Adds the new node to the scene tree so that Godot can run and draw it. -
return lineFinishes the function and hands its result back to the caller. The expression reads line. -
static func button(column: Container, caption: String, action: Callable) -> Button:Defines button, a reusable set of instructions. Parameters between the parentheses receive inputs. A return type after the arrow tells you which kind of result to expect. -
var control := Button.new()Creates a variable named control. The expression creates a new Button object. Godot infers the type from the first value. -
control.text = captionUpdates control.text, which controls the words a player sees. The expression reads caption. -
control.custom_minimum_size.y = 48Stores the new value in control.custom_minimum_size.y. The expression uses the whole number 48. -
control.pressed.connect(action)Links a signal to the function that should run when the event happens. -
column.add_child(control)Adds the new node to the scene tree so that Godot can run and draw it. -
return controlFinishes the function and hands its result back to the caller. The expression reads control.
Find and fix a bug
If the Android preset reports a missing SDK, validate that the directory contains the SDK’s platform and build tools. After changing the SDK target, rerun the export and review the actual upload diagnostics.
Try a change
Ages 10–12: explain which package goes to the test phone and which goes to Play. Ages 13–16: build a two-device test table with space for target API, repeated-tap bugs, screen clipping and offline results.