@@ -10,6 +10,24 @@ PID_RETRIES=10
1010LOGCAT_FILTERS=" Godot,godot,sentry-godot,sentry-native"
1111EXPORT_PRESET=" Android CI"
1212
13+ usage () {
14+ echo " Usage: $0 [OPTIONS]"
15+ echo " "
16+ echo " Run unit tests on a local Android device."
17+ echo " "
18+ echo " OPTIONS:"
19+ echo " -v, --verbose Enable additional output"
20+ echo " -h, --help Display this help message"
21+ echo " "
22+ echo " PREREQUISITES:"
23+ echo " - Godot Engine 4.5 or later with Android export templates installed"
24+ echo " - Android SDK with ADB (Android Debug Bridge) tools"
25+ echo " - Android device connected and authorized for debugging"
26+ echo " "
27+ echo " ENVIRONMENT VARIABLES:"
28+ echo " GODOT Path to Godot executable (if not in PATH)"
29+ }
30+
1331# Formatted output
1432highlight () { echo -e " \033[1;34m$1 \033[0m" ; }
1533msg () { echo -e " \033[1m$1 \033[0m" ; }
@@ -32,25 +50,6 @@ abort() {
3250 exit 1
3351}
3452
35- # Display usage information
36- usage () {
37- echo " Usage: $0 [OPTIONS]"
38- echo " "
39- echo " Run unit tests on a local Android device."
40- echo " "
41- echo " OPTIONS:"
42- echo " -v, --verbose Enable additional output"
43- echo " -h, --help Display this help message"
44- echo " "
45- echo " PREREQUISITES:"
46- echo " - Godot Engine 4.5 or later with Android export templates installed"
47- echo " - Android SDK with ADB (Android Debug Bridge) tools"
48- echo " - Android device connected and authorized for debugging"
49- echo " "
50- echo " ENVIRONMENT VARIABLES:"
51- echo " GODOT Path to Godot executable (if not in PATH)"
52- }
53-
5453# Parse command line options
5554verbose=false
5655
@@ -85,7 +84,9 @@ if [ -z "$godot" ] || [ ! -x "$godot" ]; then
8584 error " Godot executable not found. Please ensure 'godot' is in PATH or set GODOT environment variable."
8685 exit 1
8786fi
87+
8888" $godot " --path project --headless --install-android-build-template --export-debug " $EXPORT_PRESET " ../exports/android.apk
89+
8990if [ $? -ne 0 ]; then
9091 warning " Godot export process returned an error. Proceeding anyway..."
9192fi
@@ -150,6 +151,7 @@ run_tests() {
150151 fi
151152 sleep 1
152153 done
154+
153155 if [ -z " $pid " ]; then
154156 error " Failed to get PID of the app"
155157 return 3
0 commit comments