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 }} diff --git a/scripts/start-android.sh b/scripts/start-android.sh index 6b7fecb5d..02b4cc306 100755 --- a/scripts/start-android.sh +++ b/scripts/start-android.sh @@ -3,21 +3,34 @@ # 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: $PATH" + ARCH=${ANDROID_ARCH:-"x86"} API_LEVEL=${ANDROID_API:-"29"} 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 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..." $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."