Skip to content

Commit 3803de3

Browse files
author
Chris Warren-Smith
committed
ANDROID: setup to save debug files for crash investigations.
1 parent 45ebb9e commit 3803de3

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/platform/android/Makefile.am

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
# Download the GNU Public License (GPL) from www.gnu.org
66
#
77

8+
#
9+
# For investigating crash reports in play-studio, for example:
10+
# aarch64-linux-android-addr2line -e symbols/v12.31-87/arm64-v8a/libsmallbasic.so.dbg -f -C 0x00000000000d2dd0
11+
#
12+
813
all-am: Makefile
914

1015
build-test: ndk-build-test
@@ -32,6 +37,18 @@ ndk-build-release:
3237

3338
release:
3439
(./gradlew clean :app:bundle)
40+
@echo "Saving debug symbols..."
41+
@VERSION_CODE=$$(sed -n 's/^[[:space:]]*versionCode[[:space:]]*\([0-9]*\).*/\1/p' app/build.gradle); \
42+
VERSION_NAME=$$(sed -n "s/^[[:space:]]*versionName[[:space:]]*['\"]\\([^'\"]*\\)['\"].*/\\1/p" app/build.gradle); \
43+
SYMBOL_DIR="symbols/v$${VERSION_NAME}-$${VERSION_CODE}"; \
44+
mkdir -p "$${SYMBOL_DIR}"; \
45+
if [ -d app/build/intermediates/native_debug_metadata/release/extractReleaseNativeDebugMetadata/out ]; then \
46+
cp -r app/build/intermediates/native_debug_metadata/release/extractReleaseNativeDebugMetadata/out/* "$${SYMBOL_DIR}/"; \
47+
echo "Symbols saved to $${SYMBOL_DIR}/"; \
48+
ls -lh "$${SYMBOL_DIR}"/*/*.dbg; \
49+
else \
50+
echo "Warning: debug symbols not found"; \
51+
fi
3552

3653
library:
3754
(./gradlew clean assemble)

src/platform/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ android {
99
applicationId 'net.sourceforge.smallbasic'
1010
minSdkVersion 21
1111
targetSdkVersion 36
12-
versionCode 87
12+
versionCode 88
1313
versionName '12.31'
1414
resourceConfigurations += ['en']
1515
}

0 commit comments

Comments
 (0)