@@ -298,6 +298,8 @@ runs:
298298
299299 # # Launch AVD
300300
301+ # # Launch AVD
302+
301303 - name : Install Android system image
302304 if : ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }}
303305 run : |
@@ -306,25 +308,40 @@ runs:
306308 "${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager" --install "$IMAGE"
307309 shell : bash
308310
311+ - name : Set ANDROID_AVD_HOME for downstream steps
312+ if : ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }}
313+ shell : bash
314+ run : |
315+ echo "ANDROID_AVD_HOME=$HOME/.android/avd" >> "$GITHUB_ENV"
316+ mkdir -p "$HOME/.android/avd"
317+
309318 - name : Create Android Virtual Device (AVD)
310319 if : ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }}
311320 run : |
312321 IMAGE="system-images;android-${{ inputs.android-api-level }};google_apis;x86_64"
322+ echo "Creating AVD with image: $IMAGE"
313323 echo "no" | "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" create avd \
314324 --name "${{ inputs.android-avd-name }}" \
315325 --package "$IMAGE" \
316326 --device "${{ inputs.android-device }}"
317327 shell : bash
318328
329+ - name : List available AVDs
330+ if : ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }}
331+ run : |
332+ echo "✅ Available AVDs:"
333+ "${ANDROID_HOME}/cmdline-tools/latest/bin/avdmanager" list avd || true
334+
319335 # Launch Android Emulator
320336 - name : Launch Android Emulator
321- if : ${{ inputs.platform == 'android' }} && ${{ inputs.setup-simulator == 'true' }}
322- run : $ANDROID_HOME/emulator/emulator -avd test_e2e_avd -no-audio -no-boot-anim -no-window -verbose
337+ if : ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }}
338+ run : |
339+ "$ANDROID_HOME/emulator/emulator" -avd "${{ inputs.android-avd-name }}" -no-audio -no-boot-anim -no-window -verbose
323340 shell : bash
324341
325342 # # Wait for Emulator to Boot
326343 - name : Wait for Android Emulator to Boot
327- if : ${{ inputs.platform == 'android' }} && ${{ inputs.setup-simulator == 'true' }}
344+ if : ${{ inputs.platform == 'android' && inputs.setup-simulator == 'true' }}
328345 run : |
329346 echo "Waiting for emulator to be ready..."
330347 adb wait-for-device
@@ -350,3 +367,4 @@ runs:
350367 exit 1
351368 shell : bash
352369
370+
0 commit comments