From e7ba499dcaa544fdf90545e4c5266dc3c179a666 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 3 May 2024 16:12:19 +0200 Subject: [PATCH 1/8] fix: android test emulator start-script --- scripts/start-android.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/start-android.sh b/scripts/start-android.sh index 6b7fecb5d..9754f45d1 100755 --- a/scripts/start-android.sh +++ b/scripts/start-android.sh @@ -9,15 +9,18 @@ AVD_EMULATOR_NAME="sentry_android_${ARCH}" IMAGE=${ANDROID_IMAGE:-"system-images;android-${API_LEVEL};google_apis;${ARCH}"} # Create an Android Virtual Device +echo "Create Test AVDs..." echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n $AVD_EMULATOR_NAME -k "$IMAGE" --force +echo "List available AVDs..." $ANDROID_HOME/emulator/emulator -list-avds -echo "Starting emulator..." - # Start emulator in background +echo "Starting emulator..." nohup $ANDROID_HOME/emulator/emulator -avd $AVD_EMULATOR_NAME -no-snapshot > /dev/null 2>&1 & +echo "Wait for emulator availability..." $ANDROID_HOME/platform-tools/adb wait-for-device shell 'ls' +echo "Verify emulator devices as running..." $ANDROID_HOME/platform-tools/adb devices echo "Emulator started." From 54d4dd9d44a5f546343638ce5d05f042c8ca30e1 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 3 May 2024 16:21:50 +0200 Subject: [PATCH 2/8] Update start-android.sh --- scripts/start-android.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/start-android.sh b/scripts/start-android.sh index 9754f45d1..c38ccf1f9 100755 --- a/scripts/start-android.sh +++ b/scripts/start-android.sh @@ -9,7 +9,11 @@ AVD_EMULATOR_NAME="sentry_android_${ARCH}" IMAGE=${ANDROID_IMAGE:-"system-images;android-${API_LEVEL};google_apis;${ARCH}"} # Create an Android Virtual Device -echo "Create Test AVDs..." +echo "Create Test AVDs with..." +echo "ARCH = $ARCH" +echo "API_LEVEL = $API_LEVEL" +echo "AVD_EMULATOR_NAME = $AVD_EMULATOR_NAME" +echo "IMAGE = $IMAGE" echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n $AVD_EMULATOR_NAME -k "$IMAGE" --force echo "List available AVDs..." From 0e970aa0120d668139dedbc61e9ae37ee67dfbbb Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 3 May 2024 16:48:10 +0200 Subject: [PATCH 3/8] Update start-android.sh --- scripts/start-android.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/start-android.sh b/scripts/start-android.sh index c38ccf1f9..b17ca11aa 100755 --- a/scripts/start-android.sh +++ b/scripts/start-android.sh @@ -3,6 +3,10 @@ # Adapted from: # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/android?view=azure-devops#test-on-the-android-emulator +java -version +javac -version +echo $PATH + ARCH=${ANDROID_ARCH:-"x86"} API_LEVEL=${ANDROID_API:-"29"} AVD_EMULATOR_NAME="sentry_android_${ARCH}" From a21dd64d31550cdcd7b64b5abb8dde8073ebec50 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 3 May 2024 16:58:47 +0200 Subject: [PATCH 4/8] pin android-test images to macOS 12 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 833b4269b..de6371f4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,14 +91,14 @@ jobs: # The Android emulator is currently only available on macos, see: # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/android?view=azure-devops#test-on-the-android-emulator - name: Android (old API/NDK) - os: macOs-latest + os: macOs-12 ANDROID_API: 16 ANDROID_NDK: 20.1.5948944 ANDROID_ARCH: x86 - name: Android (new API/NDK) - os: macOs-latest - ANDROID_API: 32 - ANDROID_NDK: 25.0.8775105 + os: macOs-12 + ANDROID_API: 34 + ANDROID_NDK: 26.1.10909125 ANDROID_ARCH: x86_64 name: ${{ matrix.name }} From 73c6c24e3b117b52cc9e51981396fb149fe979eb Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 3 May 2024 17:16:19 +0200 Subject: [PATCH 5/8] try macOS 13 for the Android test runners --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de6371f4b..e42a9ec1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,12 +91,12 @@ jobs: # The Android emulator is currently only available on macos, see: # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/android?view=azure-devops#test-on-the-android-emulator - name: Android (old API/NDK) - os: macOs-12 + os: macOs-13 ANDROID_API: 16 ANDROID_NDK: 20.1.5948944 ANDROID_ARCH: x86 - name: Android (new API/NDK) - os: macOs-12 + os: macOs-13 ANDROID_API: 34 ANDROID_NDK: 26.1.10909125 ANDROID_ARCH: x86_64 From bb188e3278bd3204668388f4df8df8fdc8d4b359 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 3 May 2024 17:27:01 +0200 Subject: [PATCH 6/8] pin to macOS 12 since 13 also failed --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e42a9ec1d..de6371f4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,12 +91,12 @@ jobs: # The Android emulator is currently only available on macos, see: # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/android?view=azure-devops#test-on-the-android-emulator - name: Android (old API/NDK) - os: macOs-13 + os: macOs-12 ANDROID_API: 16 ANDROID_NDK: 20.1.5948944 ANDROID_ARCH: x86 - name: Android (new API/NDK) - os: macOs-13 + os: macOs-12 ANDROID_API: 34 ANDROID_NDK: 26.1.10909125 ANDROID_ARCH: x86_64 From 3991988694a6ebf2a98c3897cf58058c356a66d1 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 3 May 2024 17:28:38 +0200 Subject: [PATCH 7/8] Add clearer logging to emulator start script --- scripts/start-android.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/start-android.sh b/scripts/start-android.sh index b17ca11aa..9d58d97c9 100755 --- a/scripts/start-android.sh +++ b/scripts/start-android.sh @@ -3,9 +3,11 @@ # Adapted from: # https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/android?view=azure-devops#test-on-the-android-emulator +echo "java version:" java -version +echo "javac version javac -version -echo $PATH +echo "PATH: $PATH" ARCH=${ANDROID_ARCH:-"x86"} API_LEVEL=${ANDROID_API:-"29"} From c5e58e947ee8e91be00ef49fe8552d3378caa8fc Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Fri, 3 May 2024 17:59:20 +0200 Subject: [PATCH 8/8] fix typo --- scripts/start-android.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start-android.sh b/scripts/start-android.sh index 9d58d97c9..02b4cc306 100755 --- a/scripts/start-android.sh +++ b/scripts/start-android.sh @@ -5,7 +5,7 @@ echo "java version:" java -version -echo "javac version +echo "javac version" javac -version echo "PATH: $PATH"