Skip to content

Commit 8a06872

Browse files
authored
fix(build-system-tests): pin ANDROID_AVD_HOME so emulator finds the created AVD (#7043)
1 parent 20cc283 commit 8a06872

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/reusable-build-system-test-react-native.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ jobs:
8888
if: ${{ matrix.platform == 'android' }}
8989
run: |
9090
echo "ANDROID_HOME=$ANDROID_HOME"
91+
# The new avdmanager writes AVDs to $HOME/.config/.android/avd, but the
92+
# emulator looks in $ANDROID_AVD_HOME (default $HOME/.android/avd). Pin both
93+
# tools to the same directory so the created AVD is actually found, and
94+
# persist it via $GITHUB_ENV so the "Start Android emulator" step agrees.
95+
export ANDROID_AVD_HOME="$HOME/.android/avd"
96+
echo "ANDROID_AVD_HOME=$ANDROID_AVD_HOME" >> "$GITHUB_ENV"
97+
mkdir -p "$ANDROID_AVD_HOME"
9198
yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses > /dev/null || true
9299
$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install "platform-tools" "emulator" "build-tools;33.0.2" "platforms;android-27" "system-images;android-27;default;x86_64"
93100
# `--tag` and `--abi` must be passed explicitly: without them avdmanager

0 commit comments

Comments
 (0)