Skip to content

Commit 132a62f

Browse files
Add native debug symbols doc for Android
1 parent 4bb75ac commit 132a62f

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

tutorials/platform/android/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ Android
1111
android_plugin
1212
android_in_app_purchases
1313
javaclasswrapper_and_androidruntimeplugin
14+
native_debug_symbols
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
.. _doc_native_debug_symbols:
2+
3+
Native Debug Symbols
4+
====================
5+
6+
When your game crashes on Android, you often see obfuscated stack traces in Play Console or other crash reporting tools like Firebase Crashlytics.
7+
To make these stack traces human-readable (symbolicated), you need native debug symbols that correspond to your game's exported build.
8+
9+
Godot now provides downloadable native debug symbols for each official export template.
10+
11+
Getting Native Debug symbols for official templates
12+
---------------------------------------------------
13+
14+
Native debug symbol files are provided for every stable Godot release and can be downloaded from the `GitHub release page <https://github.com/godotengine/godot/releases/>`_.
15+
16+
For example, to get the native debug symbols for version ``4.5.1.stable``:
17+
18+
- Go to `4.5.1.stable release page <https://github.com/godotengine/godot/releases/>`_
19+
- Download the release artifact ``Godot_native_debug_symbols.4.5.1.stable.template_release.android.zip``
20+
21+
Getting Native Debug symbols for custom builds
22+
----------------------------------------------
23+
24+
Your exported template and its native debug symbols must come from the **same build**, so you can use the official symbols only if you are using the **official export templates**.
25+
If you are building **custom export templates**, you need to generate matching symbol files yourself.
26+
27+
To do so, add ``debug_symbols=yes separate_debug_symbols=yes`` to your scons build command.
28+
This will generate a file named ``android-template-release-native-symbols.zip`` containing the native debug symbols for your custom build.
29+
30+
For example,
31+
32+
::
33+
34+
scons platform=android target=template_release debug_symbols=yes separate_debug_symbols=yes generate_android_binaries=yes
35+
36+
If you are building for multiple architectures, you should include the ``separate_debug_symbols=yes`` option only in the last build command,
37+
similar to how ``generate_android_binaries=yes`` is used.
38+
39+
::
40+
41+
scons platform=android arch=arm32 target=template_release debug_symbols=yes
42+
scons platform=android arch=arm64 target=template_release debug_symbols=yes
43+
scons platform=android arch=x86_32 target=template_release debug_symbols=yes
44+
scons platform=android arch=x86_64 target=template_release debug_symbols=yes separate_debug_symbols=yes generate_android_binaries=yes
45+
46+
Uploading Symbols to Google Play Console
47+
----------------------------------------
48+
49+
Follow these steps to upload the native debug symbols:
50+
51+
1. Open `Play Console <https://play.google.com/console>`_.
52+
2. Select any app.
53+
3. In the left menu, navigate to ``Test and release > Latest releases and bundles``.
54+
4. Now choose the relevant bundle and open it.
55+
5. Select the ``Downloads`` tab, and scroll down to the ``Assets`` section.
56+
6. Next to ``Native debug symbols``, click the upload arrow icon.
57+
7. Select and upload the corresponding native debug symbols file for that build version.
58+
59+
Alternatively, you can upload the symbols when creating a new release:
60+
61+
1. On the Create release page, locate your new release bundle.
62+
2. Click the three-dot menu beside it.
63+
3. Choose ``Upload native debug symbols (.zip)`` from the menu.
64+
4. Select and upload the corresponding native debug symbols file for that build version.
65+
66+
Manually Symbolicating Crash Logs
67+
---------------------------------
68+
69+
You can also symbolicate the crash logs manually using the `ndk-stack <https://developer.android.com/ndk/guides/ndk-stack>`_ tool included in the Android NDK.
70+
71+
1. Extract the native debug symbols zip you downloaded earlier (or generated with your custom build).
72+
2. Save your crash log to a text file (for example, ``crash.txt``).
73+
3. Run ndk-stack with the path to the symbol directory that matches the crash's CPU architecture (for example, arm64-v8a):
74+
75+
::
76+
77+
ndk-stack -sym path/to/native_debug_symbols/arm64-v8a/ -dump crash.txt
78+
79+
4. The output will display a symbolicated trace, showing file names and line numbers in Godot's source code (or your custom build).

0 commit comments

Comments
 (0)