Skip to content

Commit 03cf5ed

Browse files
author
greweb
committed
optimize: more aggressive Android Detox resource optimization
- Downgrade to Android API 28 (smallest system images) - Reduce memory to 768MB (minimum viable) - Add wipe-data flag for clean emulator state - Increase boot timeout to 15 minutes - Remove all unused system images to free disk space - Update cache key for API 28 This should resolve the persistent 'Timeout waiting for emulator to boot' issue by using the most minimal Android configuration possible.
1 parent a56e86d commit 03cf5ed

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ jobs:
647647
path: |
648648
~/.android/avd/*
649649
~/.android/adb*
650-
key: avd-29-pixel3a
650+
key: avd-28-pixel3a
651651

652652
- name: Install dependencies
653653
run: npm install --legacy-peer-deps
@@ -669,18 +669,26 @@ jobs:
669669
sudo apt-get clean
670670
sudo rm -rf /usr/share/dotnet
671671
sudo rm -rf /usr/local/lib/android/sdk/emulator/qemu/linux-x86_64/qemu-system-*
672+
sudo rm -rf /usr/local/lib/android/sdk/system-images/android-30
673+
sudo rm -rf /usr/local/lib/android/sdk/system-images/android-29
674+
sudo rm -rf /usr/local/lib/android/sdk/system-images/android-31
675+
sudo rm -rf /usr/local/lib/android/sdk/system-images/android-32
676+
sudo rm -rf /usr/local/lib/android/sdk/system-images/android-33
677+
sudo rm -rf /usr/local/lib/android/sdk/system-images/android-34
678+
sudo rm -rf /usr/local/lib/android/sdk/system-images/android-35
672679
df -h
673680
674681
- name: Create AVD and run Detox tests
675682
uses: reactivecircus/android-emulator-runner@v2
676683
with:
677-
api-level: 29
684+
api-level: 28
678685
target: google_apis
679686
arch: x86_64
680687
profile: pixel_3a
681688
force-avd-creation: false
682-
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save -no-snapshot-load -memory 1024 -cores 1 -qemu -enable-kvm -partition-size 2048
689+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none -no-snapshot-save -no-snapshot-load -memory 768 -cores 1 -qemu -enable-kvm -partition-size 1024 -no-snapshot -wipe-data
683690
disable-animations: true
691+
emulator-boot-timeout: 900
684692
script: |
685693
cd example
686694
echo "🚀 Starting Metro bundler..."

example/.detoxrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ module.exports = {
3535
emulator: {
3636
type: 'android.emulator',
3737
device: {
38-
avdName: 'pixel_3a_API_29_extension_level_7_x86_64',
38+
avdName: 'pixel_3a_API_28_extension_level_7_x86_64',
3939
},
4040
},
4141
},

0 commit comments

Comments
 (0)