@@ -83,9 +83,8 @@ Building the export templates
83
83
84
84
Godot needs two export templates for Android: the optimized "release"
85
85
template (``android_release.apk ``) and the debug template (``android_debug.apk ``).
86
- As Google will require all APKs to include ARMv8 (64-bit) libraries starting
87
- from August 2019, the commands below will build an APK containing both
88
- ARMv7 and ARMv8 libraries.
86
+ As Google requires all APKs to include ARMv8 (64-bit) libraries since August 2019,
87
+ the commands below build an APK containing both ARMv7 and ARMv8 libraries.
89
88
90
89
Compiling the standard export templates is done by calling SCons from the Godot
91
90
root directory with the following arguments:
@@ -95,13 +94,13 @@ root directory with the following arguments:
95
94
::
96
95
97
96
scons platform=android target=template_release arch=arm32
98
- scons platform=android target=template_release arch=arm64
99
- cd platform/android/java
100
- # On Windows
101
- .\gradlew generateGodotTemplates
102
- # On Linux and macOS
103
- ./gradlew generateGodotTemplates
97
+ scons platform=android target=template_release arch=arm64 generate_apk=yes
104
98
99
+ .. note ::
100
+
101
+ If you are changing the list of architectures you're building, remember to add
102
+ ``generate_apk=yes `` to the *last * architecture you're building, so that an APK
103
+ file is generated after the build.
105
104
106
105
The resulting APK will be located at ``bin/android_release.apk ``.
107
106
@@ -110,13 +109,7 @@ The resulting APK will be located at ``bin/android_release.apk``.
110
109
::
111
110
112
111
scons platform=android target=template_debug arch=arm32
113
- scons platform=android target=template_debug arch=arm64
114
- cd platform/android/java
115
- # On Windows
116
- .\gradlew generateGodotTemplates
117
- # On Linux and macOS
118
- ./gradlew generateGodotTemplates
119
-
112
+ scons platform=android target=template_debug arch=arm64 generate_apk=yes
120
113
121
114
The resulting APK will be located at ``bin/android_debug.apk ``.
122
115
@@ -128,7 +121,7 @@ The resulting APK will be located at ``bin/android_debug.apk``.
128
121
Adding support for x86 devices
129
122
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130
123
131
- If you also want to include support for x86 and x86-64 devices, run the SCons
124
+ If you also want to include support for x86 and x86_64 devices, run the SCons
132
125
command a third and fourth time with the ``arch=x86_32 ``, and
133
126
``arch=x86_64 `` arguments before building the APK with Gradle. For
134
127
example, for the release template:
@@ -138,13 +131,7 @@ example, for the release template:
138
131
scons platform=android target=template_release arch=arm32
139
132
scons platform=android target=template_release arch=arm64
140
133
scons platform=android target=template_release arch=x86_32
141
- scons platform=android target=template_release arch=x86_64
142
- cd platform/android/java
143
- # On Windows
144
- .\gradlew generateGodotTemplates
145
- # On Linux and macOS
146
- ./gradlew generateGodotTemplates
147
-
134
+ scons platform=android target=template_release arch=x86_64 generate_apk=yes
148
135
149
136
This will create a fat binary that works on all platforms.
150
137
The final APK size of exported projects will depend on the platforms you choose
@@ -188,7 +175,7 @@ with their respective names. The templates folder can be located in:
188
175
- macOS: ``$HOME/Library/Application Support/Godot/export_templates/<version>/ ``
189
176
190
177
``<version> `` is of the form ``major.minor[.patch].status `` using values from
191
- ``version.py `` in your Godot source repository (e.g. ``3.0.5 .stable `` or ``3.1 .dev ``).
178
+ ``version.py `` in your Godot source repository (e.g. ``4.1.3 .stable `` or ``4.2 .dev ``).
192
179
You also need to write this same version string to a ``version.txt `` file located
193
180
next to your export templates.
194
181
@@ -216,13 +203,11 @@ root directory with the following arguments:
216
203
scons platform=android arch=arm32 production=yes target=editor
217
204
scons platform=android arch=arm64 production=yes target=editor
218
205
scons platform=android arch=x86_32 production=yes target=editor
219
- scons platform=android arch=x86_64 production=yes target=editor
220
- cd platform/android/java
221
- # On Windows
222
- .\gradlew generateGodotEditor
223
- # On Linux and macOS
224
- ./gradlew generateGodotEditor
206
+ scons platform=android arch=x86_64 production=yes target=editor generate_apk=yes
225
207
208
+ You can skip certain architectures depending on your target device to speed up
209
+ compilation. Remember to add ``generate_apk=yes `` to the *last * architecture
210
+ you're building, so that an APK file is generated after the build.
226
211
227
212
The resulting APK will be located at ``bin/android_editor_builds/android_editor-release.apk ``.
228
213
0 commit comments