Skip to content

Commit 9354cec

Browse files
committed
Try to run the Android emulator
1 parent 40ac114 commit 9354cec

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,27 @@ jobs:
1212
fail-fast: false
1313
runs-on: ${{ matrix.os }}
1414
steps:
15+
- name: "Launch emulator"
16+
run: |
17+
# Install AVD files
18+
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --install 'system-images;android-35;google_apis;x86_64'
19+
20+
# Create emulator
21+
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/avdmanager create avd -n xamarin_android_emulator -d "Nexus 10" -k 'system-images;android-35;google_apis;x86_64' --force
22+
23+
echo "y" | $ANDROID_HOME/emulator/emulator -list-avds
24+
25+
echo "Starting emulator"
26+
27+
# Start emulator in background
28+
nohup $ANDROID_HOME/emulator/emulator -avd xamarin_android_emulator -no-snapshot -no-window -no-audio -no-boot-anim -accel on > /dev/null 2>&1 &
29+
# Fixed quoting around "\r"
30+
$ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d "\r") ]]; do sleep 1; done; input keyevent 82'
31+
32+
$ANDROID_HOME/platform-tools/adb devices
33+
34+
echo "Emulator started"
35+
1536
- name: "Check emulator"
1637
run: |
1738
find ${ANDROID_HOME} -name sdkmanager

0 commit comments

Comments
 (0)