banner
xingli

xingli

猫娘爱好者

Godot 4 Export Android apk

image

Reference official tutorial:

https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_android.html

1. Software to download#

OpenJDK 11+

https://adoptium.net/zh-CN/temurin/releases/?version=11

It is recommended to download the compressed package, unzip it, and then add the environment variable

JAVA_HOME

jdk11 storage folder, mine is C:\Program Files\Java\jdk11.0.18_10

image

Android Studio

https://developer.android.google.cn/studio?hl=zh-cn

After installing Android Studio, open it

image

Choose SDK 32.0.0 (default for Godot) and 30.0.3

image

Choose NDK r23c (23.2.8568313)

image

Choose CMake 3.10.2

image

2. Generate a key#

A debug keystore needs to be generated. Open cmd, switch to the bin folder of the jdk11 storage path, and run the following command

keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999 -deststoretype pkcs12

image

3. Add sdk location and debug key#

Open Godot, Editor → Editor Settings → Android

image

Add the Android SDK path, which is usually C:\Users\YourUsername\AppData\Local\Android\Sdk

The debug keystore is located in the bin folder

Keep the debug keystore username and password unchanged

androiddebugkey

android

4. Install export templates#

image

image

Download link for export templates

https://downloads.tuxfamily.org/godotengine/

Choose Godot_v4.0-stable_export_templates.tpz in the corresponding version

Project → Install Android Build Template

image

5. Export settings#

Project → Project Settings

Make sure to check Import STC ASTC

image

5.1 Debug export#

In the export settings

Check Use Gradle build (Target SDK can be overridden)

Target SDK is 30

If Use Gradle build is not checked, the target SDK cannot be overridden, and the default SDK 32.0.0 will be used to export the apk

Check arm64

Fill in the debug keystore location, username and password are the same as above

Modify the name and unique name, the format is shown in the image

Make sure to check Sign, otherwise the apk will not be installable

image

image

5.2 Release export#

If used for release

keytool -v -genkey -keystore mygame.keystore -alias mygame -keyalg RSA -validity 10000

The user is mygame, please modify it yourself

The key needs to be set by yourself

When using Project Export, do not check Debug Export

Use Export All, click Publish

image

image

image

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.