Skip to content

Commit aa38f8f

Browse files
Add native debug symbols doc for Android
1 parent 99175ce commit aa38f8f

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-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: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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. However, For custom template
10+
you'd have to generate those when building your template.
11+
12+
Getting the Native Debug Symbols
13+
--------------------------------
14+
15+
There are two ways to obtain native debug symbols, depending on whether you are using the official export templates or building custom templates.
16+
17+
1. Getting Native Debug symbols for Official template
18+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19+
20+
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/>`_.
21+
22+
For example, to get the native debug symbols for version ``4.5.1.stable``:
23+
24+
- Go to `4.5.1.stable release page <https://github.com/godotengine/godot/releases/>`_
25+
- Download the release artifact ``Godot_native_debug_symbols.4.5.1.stable.template_release.android.zip``
26+
27+
2. Getting Native Debug symbols for custom build
28+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29+
30+
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**.
31+
If you are building **custom export templates**, you need to generate matching symbol files yourself.
32+
33+
To do so, add ``debug_symbols=yes separate_debug_symbols=yes`` to your scons build command.
34+
This will generate a file named ``android-template-release-native-symbols.zip`` containing the native debug symbols for your custom build.
35+
36+
For example,
37+
38+
::
39+
40+
scons platform=android target=template_release debug_symbols=yes separate_debug_symbols=yes generate_android_binaries=yes
41+
42+
Uploading Symbols to Google Play Console
43+
----------------------------------------
44+
45+
Follow these steps to upload the native debug symbols:
46+
47+
1. Open `Play Console <https://play.google.com/console>`_.
48+
2. Select any app.
49+
3. On the left menu, navigate to ``Test and release > Latest releases and bundles``.
50+
4. Now choose the relevant bundle and open it.
51+
5. Select the ``Downloads`` tab, and scroll down to the ``Assets`` section.
52+
6. Next to ``Native debug symbols``, click the upload arrow icon.
53+
7. Select and upload the corresponding native debug symbols file for that build version.
54+
55+
Alternatively, you can upload the symbols when creating a new release:
56+
57+
1. On the Create release page, locate your new release bundle.
58+
2. Click the three-dot menu beside it.
59+
3. Choose ``Upload native debug symbols (.zip)`` from the menu.
60+
4. Select and upload the corresponding native debug symbols file for that build version.
61+
62+
Manually Symbolicating Crash Logs
63+
---------------------------------
64+
65+
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.
66+
67+
1. Extract the native debug symbols zip you downloaded earlier (or generated with your custom build).
68+
2. Save your crash log into a text file (for example, crash.txt).
69+
3. Run ndk-stack with the path to the symbol directory that matches the crash’s CPU architecture (for example, arm64-v8a):
70+
71+
::
72+
73+
ndk-stack -sym path/to/native_debug_symbols/arm64-v8a/ -dump crash.txt
74+
75+
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)